+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Pascal language for HP49-50 (/thread-15914.html)
{--------------------------}
Procedure DessineMur;
Begin
PutBloc(10,10,g_Level);
GotoXY(11,6); Write(Niveau);
GotoXY(3,8); Write('Press ENTER to play');
If SoundOn Then Begin
Beep(349,100); Beep(392,200); Beep(349,100); Beep(392,200); Beep(493,200); Beep(523,400);End
Else c:=ReadKey;
Clearbar(5,5,95,70);
TotBrique:=0;
Box(0,0,100,80);
For i:=1 To 14 Do
For j:=0 To 15 Do
If Tableau[((Niveau-1) MOD NbTableau)+1,j][i]='X' Then Begin
Bar((i-1)*7+2,j*4+2,i*7,j*4+4); TotBrique:=TotBrique+1;
If SoundOn Then Beep(Random(1000)+200,15);
End;
Bar(Rx,78,Rx+LrgRqt,79);
GotoXY(26,2); Write(Score);
GotoXY(26,5); Write(BestScore);
GotoXY(26,8); Write(Vies);
GotoXY(26,11);Write(Niveau);
Perdu:=False; GagneNiveau:=False;
Vitesse:=Difficulte-(Niveau Div (NbTableau+1)*3);
If Vitesse<2 Then Vitesse:=1;
NBrique:=0;
End;
{--------------------------}
Procedure BougeRaquette;
Var D : Char;
Begin
D:=' ';
For j:=1 To Vitesse Do Begin
If RightPressed Then D:='R';
If LeftPressed Then D:='L';
End;
Case D Of
'R': If Rx<86 Then
Begin
ClearLineV(Rx,78,79);
LineV(Rx+LrgRqt+1,78,79);
Rx:=Rx+1;
End;
'L': If Rx>1 Then
Begin
ClearLineV(Rx+LrgRqt,78,79);
LineV(Rx-1,78,79);
Rx:=Rx-1;
End;
End;
End;
{------------------------------}
Procedure BougeBalle;
Var Mx,My : Integer; Interm : Byte;
Begin
Interm:=1;
If Bx2>=99 Then Begin
Case Dir Of
1: Dir:=4;
2: Dir:=3;
7: Dir:=6;
8: Dir:=5;
End;
Bx2:=98; If SoundOn Then Beep(HzBord,MsBord);
Exit;
End;
If Bx2<=0 Then Begin
Case Dir Of
3: Dir:=2;
4: Dir:=1;
5: Dir:=8;
6: Dir:=7;
End;
Bx2:=2; If SoundOn Then Beep(HzBord,MsBord);
Exit;
End;
If By2<=0 Then Begin
Case Dir Of
1: Dir:=8;
2: Dir:=7;
3: Dir:=6;
4: Dir:=5;
End;
By2:=4; If SoundOn Then Beep(HzBord,MsBord);
Exit;
End;
BougeRaquette;
If By2=77 Then Begin
k:=Bx2; k:=k-Rx+1;
If Dir in [7,8] And (k=-1 Or (k=-2 And LeftPressed)) Then k:=0;
If Dir in [5,6] And (k=15 Or (k=16 And RightPressed)) Then k:=14;
If k>=0 And k<=LrgRqt+1 Then Begin
Case k Of
0 : Dir:=4;
1,2 : Case Dir Of 5,6: Dir:=4; 7,8: Dir:=2; End;
3..11 : Dir:=9-Dir;
12,13: Case Dir Of 5,6: Dir:=3; 7,8: Dir:=1; End;
14 : Dir:=1;
End;
If SoundOn Then Beep(HzRqt,MsRqt);
End Else Begin
Perdu:=True; ClearBar(Bx,By,Bx+1,By+1);
If SoundOn Then Beep(HzOut,MsOut);
End;
Exit;
End;
Choc:=0; TapeMur:=False;
ClearBar(Bx,By,Bx+1,By+1);
If Point(Bx2,By2) Then Choc:=1;
If Point(Bx2+1,By2) Then Choc:=Choc+2;
If Point(Bx2+1,By2+1) Then Choc:=Choc+4;
If Point(Bx2,By2+1) Then Choc:=Choc+8;
Bar(Bx,By,Bx+1,By+1);
Case Dir Of
1,2: Case Choc Of
1,3: Begin TapeMur:=True; Dir:=9-Dir; End;
2 : Begin TapeMur:=True; Dir:=Dir+4; End;
6,4: Begin TapeMur:=True; Dir:=Dir+2; End;
End;
3,4: Case Choc Of
2,3: Begin TapeMur:=True; Dir:=Dir+2; End;
1 : Begin TapeMur:=True; Dir:=Dir+4; End;
9,8: Begin TapeMur:=True; Dir:=5-Dir; End;
End;
5,6: Case Choc Of
4,12: Begin TapeMur:=True; Dir:=9-Dir; End;
8 : Begin TapeMur:=True; Dir:=Dir-4; End;
1,9 : Begin TapeMur:=True; Dir:=Dir+2; End;
End;
7,8: Case Choc Of
8,12: Begin TapeMur:=True; Dir:=9-Dir; End;
4 : Begin TapeMur:=True; Dir:=Dir-4; End;
2,6 : Begin TapeMur:=True; Dir:=Dir-2; End;
End;
End;
If TapeMur Then Begin
NBrique:=NBrique+1;
Mx:=((Bx2-1) Div 7)*7 + 1;
My:=((By2-1) Div 4)*4 + 1;
ClearBar(Mx,My,Mx+6,My+3);
If SoundOn Then Begin Beep(HzMur,MsMur); Beep(HzMur*2,MsMur); End;
Score:=Score+5; GotoXY(26,2); Write(Score); Interm:=3;
End;
Interm:=Interm+1;
If By2<77 Then Begin
ClearBar(Bx,By,Bx+1,By+1);
Bar(Bx2,By2,Bx2+1,By2+1);
End;
Bx:=Bx2; By:=By2;
Until Interm=4;
End;
Procedure Parametres(c :Char);
Begin
If Ord(c)=16 Then Halt;
Case c Of
'A' : Begin ClearBar(118,22,125,44); PutSprite(118,22,Check); Difficulte:=15; End;
'B' : Begin ClearBar(118,22,125,44); PutSprite(118,31,Check); Difficulte:=11; End;
'C' : Begin ClearBar(118,22,125,44); PutSprite(118,40,Check); Difficulte:=8; End;
'D': Begin
If SoundOn Then SoundOn:=False Else SoundOn:=True;
ClearBar(63,49,70,61);
If SoundOn Then PutSprite(64,49,Check) Else PutSprite(64,56,Check);
End;
End;
End;
Procedure Initialisation;
Begin
EnableInterrupt;ClearBar(0,0,130,79);
If SoundOn Then SoundOn:=False Else SoundOn:=True;
AppearCool(Instructions);
Parametres(Chr(68));
Case Difficulte Of
15 : Parametres(Chr(65));
11 : Parametres(Chr(66));
8 : Parametres(Chr(67));
End;
While KeyPressed Do c:=ReadKey;
Repeat
c:=ReadKey;
If SoundOn Then Beep(440,20);
Parametres(c);
Until Ord(c)=13;
DisappearCool;
End;
{-------- Programme principal -----------}
Begin
AppearCool(Breakout2); LineV(128,0,59); LineV(129,0,59);
GotoXY(7,11); Write('Press ENTER to Play');
GotoXY(7,12); Write('Press DEL<- to Exit');
c:=ReadKey; If c=Chr(16) Then Halt;
DisappearCool;
Repeat
{Nouvelle balle}
By:=75; Bx:=Rx+5; Dir:=Random(3)+1;
GotoXY(26,8); Write(Vies);
Repeat BougeRaquette; Until UpPressed Or ExitPressed Or EnterPressed;
If SoundOn Then Beep(740,300);
Bx:=Rx+6;
Perdu:=False;
Repeat
BougeBalle;
If NBrique=TotBrique Then GagneNiveau:=True;
Until GagneNiveau Or Perdu Or ExitPressed;
ClearBar(Bx,By,Bx+1,By+1);
If Perdu Then Vies:=Vies-1; GotoXY(26,8); Write(Vies);
Until Vies=0 Or GagneNiveau Or ExitPressed;
Niveau:=Niveau+1;
EnableInterrupt;
Until Vies=0 Or ExitPressed;
If Score>BestScore Then Begin
ClearBar(1,1,99,79);PutBloc(4,6,Best);
BestScore:=Score;
If SoundOn Then Begin
Beep(233,400);Beep(349,400);Beep( 311,133);Beep( 293,133);Beep( 261,133);Beep( 466,400);Beep( 349,400);
Beep( 311,133);Beep( 293,133);Beep( 261,133 );Beep(466,400 );Beep(349,400 );Beep(311,133 );
Beep(293,133 );Beep(311,133 );Beep(260,533);
End;
End;
GotoXY(5,11); Write('ENTER to replay');
GotoXY(5,12); Write(' DEL<- to exit');
ClearBar(1,78,99,79);
Repeat Until EnterPressed Or ExitPressed;
Until ExitPressed;
{--------------------------}
Procedure DessineMur;
Begin
PutBloc(10,10,g_Level);
GotoXY(11,6); Write(Niveau);
GotoXY(3,8); Write('Press ENTER to play');
If SoundOn Then Begin
Beep(349,100); Beep(392,200); Beep(349,100); Beep(392,200); Beep(493,200); Beep(523,400);End
Else c:=ReadKey;
Clearbar(5,5,95,70);
TotBrique:=0;
Box(0,0,100,80);
For i:=1 To 14 Do
For j:=0 To 15 Do
If Tableau[((Niveau-1) MOD NbTableau)+1,j][i]='X' Then Begin
Bar((i-1)*7+2,j*4+2,i*7,j*4+4); TotBrique:=TotBrique+1;
If SoundOn Then Beep(Random(1000)+200,15);
End;
Bar(Rx,78,Rx+LrgRqt,79);
GotoXY(26,2); Write(Score);
GotoXY(26,5); Write(BestScore);
GotoXY(26,8); Write(Vies);
GotoXY(26,11);Write(Niveau);
Perdu:=False; GagneNiveau:=False;
Vitesse:=Difficulte-(Niveau Div (NbTableau+1)*3);
If Vitesse<2 Then Vitesse:=1;
NBrique:=0;
End;
{--------------------------}
Procedure BougeRaquette;
Var D : Char;
Begin
D:=' ';
For j:=1 To Vitesse Do Begin
If RightPressed Then D:='R';
If LeftPressed Then D:='L';
End;
Case D Of
'R': If Rx<86 Then
Begin
ClearLineV(Rx,78,79);
LineV(Rx+LrgRqt+1,78,79);
Rx:=Rx+1;
End;
'L': If Rx>1 Then
Begin
ClearLineV(Rx+LrgRqt,78,79);
LineV(Rx-1,78,79);
Rx:=Rx-1;
End;
End;
End;
{------------------------------}
Procedure BougeBalle;
Var Mx,My : Integer; Interm : Byte;
Begin
Interm:=1;
If Bx2>=99 Then Begin
Case Dir Of
1: Dir:=4;
2: Dir:=3;
7: Dir:=6;
8: Dir:=5;
End;
Bx2:=98; If SoundOn Then Beep(HzBord,MsBord);
Exit;
End;
If Bx2<=0 Then Begin
Case Dir Of
3: Dir:=2;
4: Dir:=1;
5: Dir:=8;
6: Dir:=7;
End;
Bx2:=2; If SoundOn Then Beep(HzBord,MsBord);
Exit;
End;
If By2<=0 Then Begin
Case Dir Of
1: Dir:=8;
2: Dir:=7;
3: Dir:=6;
4: Dir:=5;
End;
By2:=4; If SoundOn Then Beep(HzBord,MsBord);
Exit;
End;
BougeRaquette;
If By2=77 Then Begin
k:=Bx2; k:=k-Rx+1;
If Dir in [7,8] And (k=-1 Or (k=-2 And LeftPressed)) Then k:=0;
If Dir in [5,6] And (k=15 Or (k=16 And RightPressed)) Then k:=14;
If k>=0 And k<=LrgRqt+1 Then Begin
Case k Of
0 : Dir:=4;
1,2 : Case Dir Of 5,6: Dir:=4; 7,8: Dir:=2; End;
3..11 : Dir:=9-Dir;
12,13: Case Dir Of 5,6: Dir:=3; 7,8: Dir:=1; End;
14 : Dir:=1;
End;
If SoundOn Then Beep(HzRqt,MsRqt);
End Else Begin
Perdu:=True; ClearBar(Bx,By,Bx+1,By+1);
If SoundOn Then Beep(HzOut,MsOut);
End;
Exit;
End;
Choc:=0; TapeMur:=False;
ClearBar(Bx,By,Bx+1,By+1);
If Point(Bx2,By2) Then Choc:=1;
If Point(Bx2+1,By2) Then Choc:=Choc+2;
If Point(Bx2+1,By2+1) Then Choc:=Choc+4;
If Point(Bx2,By2+1) Then Choc:=Choc+8;
Bar(Bx,By,Bx+1,By+1);
Case Dir Of
1,2: Case Choc Of
1,3: Begin TapeMur:=True; Dir:=9-Dir; End;
2 : Begin TapeMur:=True; Dir:=Dir+4; End;
6,4: Begin TapeMur:=True; Dir:=Dir+2; End;
End;
3,4: Case Choc Of
2,3: Begin TapeMur:=True; Dir:=Dir+2; End;
1 : Begin TapeMur:=True; Dir:=Dir+4; End;
9,8: Begin TapeMur:=True; Dir:=5-Dir; End;
End;
5,6: Case Choc Of
4,12: Begin TapeMur:=True; Dir:=9-Dir; End;
8 : Begin TapeMur:=True; Dir:=Dir-4; End;
1,9 : Begin TapeMur:=True; Dir:=Dir+2; End;
End;
7,8: Case Choc Of
8,12: Begin TapeMur:=True; Dir:=9-Dir; End;
4 : Begin TapeMur:=True; Dir:=Dir-4; End;
2,6 : Begin TapeMur:=True; Dir:=Dir-2; End;
End;
End;
If TapeMur Then Begin
NBrique:=NBrique+1;
Mx:=((Bx2-1) Div 7)*7 + 1;
My:=((By2-1) Div 4)*4 + 1;
ClearBar(Mx,My,Mx+6,My+3);
If SoundOn Then Begin Beep(HzMur,MsMur); Beep(HzMur*2,MsMur); End;
Score:=Score+5; GotoXY(26,2); Write(Score); Interm:=3;
End;
Interm:=Interm+1;
If By2<77 Then Begin
ClearBar(Bx,By,Bx+1,By+1);
Bar(Bx2,By2,Bx2+1,By2+1);
End;
Bx:=Bx2; By:=By2;
Until Interm=4;
End;
Procedure Parametres(c :Char);
Begin
If Ord(c)=16 Then Halt;
Case c Of
'A' : Begin ClearBar(118,22,125,44); PutSprite(118,22,Check); Difficulte:=15; End;
'B' : Begin ClearBar(118,22,125,44); PutSprite(118,31,Check); Difficulte:=11; End;
'C' : Begin ClearBar(118,22,125,44); PutSprite(118,40,Check); Difficulte:=8; End;
'D': Begin
If SoundOn Then SoundOn:=False Else SoundOn:=True;
ClearBar(63,49,70,61);
If SoundOn Then PutSprite(64,49,Check) Else PutSprite(64,56,Check);
End;
End;
End;
Procedure Initialisation;
Begin
EnableInterrupt;ClearBar(0,0,130,79);
If SoundOn Then SoundOn:=False Else SoundOn:=True;
AppearCool(Instructions);
Parametres(Chr(68));
Case Difficulte Of
15 : Parametres(Chr(65));
11 : Parametres(Chr(66));
8 : Parametres(Chr(67));
End;
While KeyPressed Do c:=ReadKey;
Repeat
c:=ReadKey;
If SoundOn Then Beep(440,20);
Parametres(c);
Until Ord(c)=13;
DisappearCool;
End;
{-------- Programme principal -----------}
Begin
AppearCool(Breakout2); LineV(128,0,59); LineV(129,0,59);
GotoXY(7,11); Write('Press ENTER to Play');
GotoXY(7,12); Write('Press DEL<- to Exit');
c:=ReadKey; If c=Chr(16) Then Halt;
DisappearCool;
Repeat
{Nouvelle balle}
By:=75; Bx:=Rx+5; Dir:=Random(3)+1;
GotoXY(26,8); Write(Vies);
Repeat BougeRaquette; Until UpPressed Or ExitPressed Or EnterPressed;
If SoundOn Then Beep(740,300);
Bx:=Rx+6;
Perdu:=False;
Repeat
BougeBalle;
If NBrique=TotBrique Then GagneNiveau:=True;
Until GagneNiveau Or Perdu Or ExitPressed;
ClearBar(Bx,By,Bx+1,By+1);
If Perdu Then Vies:=Vies-1; GotoXY(26,8); Write(Vies);
Until Vies=0 Or GagneNiveau Or ExitPressed;
Niveau:=Niveau+1;
EnableInterrupt;
Until Vies=0 Or ExitPressed;
If Score>BestScore Then Begin
ClearBar(1,1,99,79);PutBloc(4,6,Best);
BestScore:=Score;
If SoundOn Then Begin
Beep(233,400);Beep(349,400);Beep( 311,133);Beep( 293,133);Beep( 261,133);Beep( 466,400);Beep( 349,400);
Beep( 311,133);Beep( 293,133);Beep( 261,133 );Beep(466,400 );Beep(349,400 );Beep(311,133 );
Beep(293,133 );Beep(311,133 );Beep(260,533);
End;
End;
GotoXY(5,11); Write('ENTER to replay');
GotoXY(5,12); Write(' DEL<- to exit');
ClearBar(1,78,99,79);
Repeat Until EnterPressed Or ExitPressed;
Until ExitPressed;
RE: Pascal language for HP49-50 - CMarangon - 11-18-202003:22 PM
Hello!
This code does not compile. It returns errors:-(
RE: Pascal language for HP49-50 - toml_12953 - 11-18-202003:24 PM
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.
RE: Pascal language for HP49-50 - Gilles - 11-18-202005:39 PM
(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.
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
RE: Pascal language for HP49-50 - rprosperi - 11-18-202007:02 PM
The download link on that site is disabled.
Is that the same as the Win32 cross compiler seen here on hpcalc.org:
If you have a newer/better version, please send a copy to Eric so he can add it on hpcalc.org.
Thanks Gilles!
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
RE: Pascal language for HP49-50 - Claudio L. - 11-19-202003:11 PM
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.
RE: Pascal language for HP49-50 - toml_12953 - 11-19-202003:28 PM
(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.
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.
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.
RE: Pascal language for HP49-50 - EugeneNine - 11-19-202010:09 PM
(11-18-2020 07:02 PM)rprosperi Wrote: The download link on that site is disabled.
Is that the same as the Win32 cross compiler seen here on hpcalc.org:
If you have a newer/better version, please send a copy to Eric so he can add it on hpcalc.org.
Thanks Gilles!
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.
RE: Pascal language for HP49-50 - OtakuLab - 11-20-202008:40 AM
(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
RE: Pascal language for HP49-50 - cruff - 11-20-202002:42 PM
(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.
RE: Pascal language for HP49-50 - grsbanks - 11-20-202003:46 PM
Think DM42...
Free42 and the Intel Decimal Floating Point library are cross-compiled using an ARM toolchain on a standard PC.
RE: Pascal language for HP49-50 - pier4r - 11-20-202007:37 PM
(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.
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.
RE: Pascal language for HP49-50 - OtakuLab - 11-20-202011:20 PM
(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
RE: Pascal language for HP49-50 - pier4r - 11-22-202008:30 PM
(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.
RE: Pascal language for HP49-50 - OtakuLab - 11-23-202012:02 AM
(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
RE: Pascal language for HP49-50 - Valentin Albillo - 11-23-202001:40 AM
.
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 interpreterbut 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.
RE: Pascal language for HP49-50 - rwiker - 11-23-202006:04 AM
(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.
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
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).
RE: Pascal language for HP49-50 - OtakuLab - 11-24-202008:37 AM
(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