Pascal language for HP49-50
|
11-17-2020, 10:42 PM
(This post was last modified: 11-17-2020 10:44 PM by Gilles.)
Post: #1
|
|||
|
|||
Pascal language for HP49-50
Did you know that you can program in Pascal your HP49-50g? (By the way the compiler need a PC) :
What you can get : And the source : Code: Program CasseBriques; Link for upload : HPCALC |
|||
11-18-2020, 04:02 AM
(This post was last modified: 11-18-2020 04:05 AM by CMarangon.)
Post: #2
|
|||
|
|||
RE: Pascal language for HP49-50
I am not Allan Jackson, but I'll Try.
Do you know this online Pascal Compiller? https://www.onlinegdb.com/online_pascal_compiler (11-17-2020 10:42 PM)Gilles Wrote: Did you know that you can program in Pascal your HP49-50g? (By the way the compiler need a PC) : Carlos - Brazil Time Zone: GMT -3 http://area48.com |
|||
11-18-2020, 03:22 PM
Post: #3
|
|||
|
|||
RE: Pascal language for HP49-50
Hello!
This code does not compile. It returns errors:-( Carlos - Brazil Time Zone: GMT -3 http://area48.com |
|||
11-18-2020, 03:24 PM
Post: #4
|
|||
|
|||
RE: Pascal language for HP49-50
I wouldn't really consider this Pascal language for the HP calculators. It's a cross-compiler for the PC that generates code for the HPs.
Tom L Cui bono? |
|||
11-18-2020, 05:39 PM
Post: #5
|
|||
|
|||
RE: Pascal language for HP49-50
(11-18-2020 03:24 PM)toml_12953 Wrote: I wouldn't really consider this Pascal language for the HP calculators. It's a cross-compiler for the PC that generates code for the HPs. Yes it is... And the compiler produce Saturn Code. So you can also use it on HP48 series. And its not obvious to install the environment on Win10 because it's a very old stuf (you need compatibilty mode). As Pascal is perhaps my favorite langage I was very surprise with this and have lot of fun to use it. More information here : http://hppascal.free.fr/pages/home.htm But dont expect a perfect thing with the 49-50g. It's more for fun than for serious things. I had to change some units to work with then 50g and there are limitations with the biger screen vs H48 series. By the way I was surprise that this very old software works quite fine. I would have be very happy to knows this in the past ;D |
|||
11-18-2020, 07:02 PM
Post: #6
|
|||
|
|||
RE: Pascal language for HP49-50
The download link on that site is disabled.
Is that the same as the Win32 cross compiler seen here on hpcalc.org: https://www.hpcalc.org/details/6035 If you have a newer/better version, please send a copy to Eric so he can add it on hpcalc.org. Thanks Gilles! --Bob Prosperi |
|||
11-18-2020, 08:17 PM
Post: #7
|
|||
|
|||
RE: Pascal language for HP49-50
(11-18-2020 07:02 PM)rprosperi Wrote: The download link on that site is disabled. I see it's still there where it was when I found it, about 20 years ago, a pity. I think it's the same as Eric's version, 2.1 from 2001 Greetings, Massimo -+×÷ ↔ left is right and right is wrong |
|||
11-19-2020, 03:11 PM
Post: #8
|
|||
|
|||
RE: Pascal language for HP49-50
I wonder if the GNU Pascal front-end to gcc could be combined with gcc for ARM and used with the HPGCC or HPGCC3 libraries.
You could have Pascal language with all the advantages of direct ARM execution in the 49g+ and 50g models. |
|||
11-19-2020, 03:28 PM
Post: #9
|
|||
|
|||
RE: Pascal language for HP49-50
(11-18-2020 05:39 PM)Gilles Wrote:(11-18-2020 03:24 PM)toml_12953 Wrote: I wouldn't really consider this Pascal language for the HP calculators. It's a cross-compiler for the PC that generates code for the HPs. So you can use it to compile right on the calculator? If not then it's not "Pascal for the HP-49/50" It's "Pascal for the PC that generates code for the HP-49/50" That's by definition in English. Tom L Cui bono? |
|||
11-19-2020, 10:09 PM
Post: #10
|
|||
|
|||
RE: Pascal language for HP49-50
(11-18-2020 07:02 PM)rprosperi Wrote: The download link on that site is disabled. I've been trying to get that one working for a few years but it it appears to have some sort of old Microsoft proprietary C language extensions so it won't compile. |
|||
11-20-2020, 08:40 AM
Post: #11
|
|||
|
|||
RE: Pascal language for HP49-50
(11-19-2020 03:28 PM)toml_12953 Wrote: So you can use it to compile right on the calculator? If not then it's not "Pascal for the HP-49/50" It's "Pascal for the PC that generates code for the HP-49/50" That's by definition in English. That would at least be a more honest description of this application. The calculator itself does not understand any other language than the one implemented in its core and that is as everyone knows RPL. At this point it should also be noted that the code from a cross-compiler would be comparatively inefficient compared to the native code of the calculator. This affects both runtime and storage space and can therefore not be a reasonable alternative. __________________________________ "Move forward and do what you think is best. If you make a mistake, you’ll learn something. But don’t make the same mistake twice." - Akio Morita |
|||
11-20-2020, 02:42 PM
Post: #12
|
|||
|
|||
RE: Pascal language for HP49-50
(11-20-2020 08:40 AM)OtakuLab Wrote: At this point it should also be noted that the code from a cross-compiler would be comparatively inefficient compared to the native code of the calculator. This affects both runtime and storage space and can therefore not be a reasonable alternative. There is nothing that inherently prevents a cross compiler from generating code that is just as efficient as "native code". Cross compilers are quite common in the embedded device arena, where the device does not have sufficient resources itself to host a compiler. It is entirely possible that a cross compiler environment can produce superior code to a native compiler due to additional resources on the cross compiler's host that allows better optimizations. |
|||
11-20-2020, 03:46 PM
Post: #13
|
|||
|
|||
RE: Pascal language for HP49-50
Think DM42...
Free42 and the Intel Decimal Floating Point library are cross-compiled using an ARM toolchain on a standard PC. There are only 10 types of people in this world. Those who understand binary and those who don't. |
|||
11-20-2020, 07:37 PM
(This post was last modified: 11-20-2020 07:40 PM by pier4r.)
Post: #14
|
|||
|
|||
RE: Pascal language for HP49-50
(11-20-2020 08:40 AM)OtakuLab Wrote: The calculator itself does not understand any other language than the one implemented in its core and that is as everyone knows RPL. As far as I know with additional libraries you can run C, using HPGCC or with another firmware you have a different RPL, newRPL. Additionally I remember that there was also a Lua port of sort (unstable) https://sourceforge.net/projects/hplua/ . Then there is the HRAST basic https://www.hpmuseum.org/forum/thread-3774.html There may be others (my memory is not recalling anything else). This to say that the 50g can understand something else if there are libraries for it. Any other capable computing system is similar, in the way that it needs libraries/programs to understand other languages (and yes everyone knows that at the end of the chain all of it will be some sort of assembly code for ARM on the HP 50g). I still stick with userRPL most of the time because, although slow to execute, it is relatively fast and accomodating to develop. I check the results only every now and then (days pass in between), thus the computation is mostly finished by the time I check it. Plus many have left some snippets here and there that I try to collect here to form an organic library that is missing ( https://www.hpmuseum.org/forum/thread-10271.html additions are welcomed). Those libraries are somewhat missing for other languages. Wikis are great, Contribute :) |
|||
11-20-2020, 11:20 PM
Post: #15
|
|||
|
|||
RE: Pascal language for HP49-50
(11-20-2020 07:37 PM)pier4r Wrote: This to say that the 50g can understand something else if there are libraries for it. Any other capable computing system is similar, in the way that it needs libraries/programs to understand other languages (and yes everyone knows that at the end of the chain all of it will be some sort of assembly code for ARM on the HP 50g). A library can expand the translation of a language, but the tool with which it was created is always decisive for the quality of the machine code, no matter which high-level language is involved. Cross-compilers like GCC can also generate executable code in the same way, the compilation of GCC is thus the machine code of a typical C-compiler. But the generated code is ultimately always a compromise between the extended instruction set of any high-level language and that which is permanently installed in the calculator. External code optimization can improve the quality of the compilation, but it is in no way equal to the quality of natively created machine code. This can only be surpassed with hand-optimized assembler code. The truth is, there is no Pascal compiler for the HP 49 or 50g, not without external tools or libraries that do a translation that is processed by a non-language compiler, and that's principally a foul compromise in its nature. The GCC in particular is famous for such applications, which all have one thing in common, inefficient, lousy code! __________________________________ "Move forward and do what you think is best. If you make a mistake, you’ll learn something. But don’t make the same mistake twice." - Akio Morita |
|||
11-22-2020, 08:30 PM
Post: #16
|
|||
|
|||
RE: Pascal language for HP49-50
(11-20-2020 11:20 PM)OtakuLab Wrote: The truth is, there is no Pascal compiler for the HP 49 or 50g, not without external tools or libraries that do a translation that is processed by a non-language compiler, and that's principally a foul compromise in its nature. The GCC in particular is famous for such applications, which all have one thing in common, inefficient, lousy code! Yes my point was not on Pascal. My point was that on the calculator itself one can use other languages as well (well maybe not really C, as it has to get compiled first). This independently if at the end they get converted in sysrpl/assembly. Wikis are great, Contribute :) |
|||
11-23-2020, 12:02 AM
Post: #17
|
|||
|
|||
RE: Pascal language for HP49-50
(11-22-2020 08:30 PM)pier4r Wrote: Yes my point was not on Pascal. My point was that on the calculator itself one can use other languages as well (well maybe not really C, as it has to get compiled first). This independently if at the end they get converted in sysrpl/assembly. I know what you mean, but the problem with such code remains the same as long as it's not natively compiled into the machine code of the calculator. In the very moment a cross compiler or even worst a source-to-source compiler is used, the end result is executable but hopelessly of more or less poor quality, and this is not an acceptable solution, external or internal. One more thing in passing: the two terms concerning assembly and compiled code shouldn't be mixed up in this context, since both are object code of the respective processor, but also of different quality as I have mentioned before. __________________________________ "Move forward and do what you think is best. If you make a mistake, you’ll learn something. But don’t make the same mistake twice." - Akio Morita |
|||
11-23-2020, 01:40 AM
(This post was last modified: 11-23-2020 01:47 AM by Valentin Albillo.)
Post: #18
|
|||
|
|||
RE: Pascal language for HP49-50
.
Hi, pier4r: (11-22-2020 08:30 PM)pier4r Wrote: [...] (well maybe not really C, as it has to get compiled first). Not exactly, this baby does include a C interpreter as its built-in high-level language: "The CASIO PB-2000C is one of the rarest pocket computers, a multi-language one that included a buit-in standard (K&R) C interpreter but would accept ROM modules for programming in BASIC and Pascal, among others (Prolog, CASL, ...). It has 32 Kb of RAM (expandable via RAM card to 64 Kb) as well as a dot-matrix LCD display (4x32 char, 32x192 px), in a somewhat large, heavy unit [...] On the positive side, it admits a number of peripherals including printing, plotting, storing to tape and floppy. and RS-232 Centronics inteface, which is nice and offers lots of possibilities." Best regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
11-23-2020, 06:04 AM
Post: #19
|
|||
|
|||
RE: Pascal language for HP49-50
(11-23-2020 12:02 AM)OtakuLab Wrote:(11-22-2020 08:30 PM)pier4r Wrote: Yes my point was not on Pascal. My point was that on the calculator itself one can use other languages as well (well maybe not really C, as it has to get compiled first). This independently if at the end they get converted in sysrpl/assembly. This is simply incorrect - there is absolutely no reason that a cross compiler should produce less efficient code than a compiler for the same language running on the target machine. In fact, it is typically the other way round, as the cross compiler host is normally more powerful, and can spend more resources (memory, cpu cycles, ...) on optimizing the compiled code. Note that a cross compiler normally outputs optimized machine code for the target machine; the exception is typically when the target machine is a poor match for the source language (example: 8-bit processors, when most high-level languages assume at least 16-bit integers). |
|||
11-24-2020, 08:37 AM
Post: #20
|
|||
|
|||
RE: Pascal language for HP49-50
(11-23-2020 06:04 AM)rwiker Wrote: This is simply incorrect - there is absolutely no reason that a cross compiler should produce less efficient code than a compiler for the same language running on the target machine. In fact, it is typically the other way round, as the cross compiler host is normally more powerful, and can spend more resources (memory, cpu cycles, ...) on optimizing the compiled code. That is pure theory, unfortunately it looks different in practice. The degree of code optimization is only rudimentary in most cross compilers, so native compilers are always preferable. This is especially true when the available hardware resources of a system offer little scope for this. The more differences that have to be overcome, the greater the conversion losses. Cross compilers certainly have their advantages in many areas, but not for the mentioned calculators! __________________________________ "Move forward and do what you think is best. If you make a mistake, you’ll learn something. But don’t make the same mistake twice." - Akio Morita |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)