The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

Slashes in HP48 source code
Message #1 Posted by Kieron Abbott on 3 Feb 2006, 10:47 p.m.

I'm a new HP48 user who recently inherited my dad's old 48G. I have a question about 48 source code with slashes. In the Advanced User's Guide, there are no slashes in the program listings, but in the source on the Goodies Disks and most places online (i.e. at http://www.hpmuseum.org/software/48vigenc.htm), there are slashes "\" before each << and >>. Can someone clue me in as to what these signify, and whether they are necessary?

      
Re: Slashes in HP48 source code
Message #2 Posted by Gerson W. Barbosa on 4 Feb 2006, 1:06 a.m.,
in response to message #1 by Kieron Abbott

Those back-slashes are used to represent the 48G characters with ASCII codes above 127 with characters in the first half of the ASCII table, which is standard for all code pages. For instance, \<< and \>> stand for the program delimiters and \PI stands for the pi symbol.

Refer to the HP 48G User's Guide, page 27-16, for the complete ASCII Characters Translations table.

      
Re: Slashes in HP48 source code
Message #3 Posted by Howard Owen on 4 Feb 2006, 1:07 a.m.,
in response to message #1 by Kieron Abbott

Those slashes mark characters that don't have equivalents in ASCII. A 48/49 series calculator will insert them into an RPL program transferred in "text" mode to a PC. So, for example \<< stands for the character with decimal code 171 in the calculator's character set. \>> similarly stands for the character with code 187. If you type these translated codes into a source file on the PC, then transfer it to the calculator in text mode, the kermit server will do the opposite translation, from the backslash escaped codes to the ASCII equivalent. The hp 49g+ & 48gII_advanced user's reference manual (HP link) has a table of these translations in Appendix J. I think they are broadly similar to the 48G translations, though there might be differences in detail.

Regards,
Howard

      
Re: Slashes in HP48 source code
Message #4 Posted by Kieron Abbott on 4 Feb 2006, 12:50 p.m.,
in response to message #1 by Kieron Abbott

So, if I was going to type a program directly into my calculator from a source file on my computer, I would simply ignore the replace \<< and \>> with << and >>, and other characters such as \pi with the actual pi symbol? BTW, have you seen Pi: Faith in Chaos? It's good.

            
Re: Slashes in HP48 source code
Message #5 Posted by Howard Owen on 4 Feb 2006, 2:06 p.m.,
in response to message #4 by Kieron Abbott

Quote:
So, if I was going to type a program directly into my calculator from a source file on my computer, I would simply ignore the replace \<< and \>> with << and >>, and other characters such as \pi with the actual pi symbol?

That's right. Most of the escaped symbols are easy to guess, like \>>, \<< and \->. For others you need the tables Gerson and I pointed you to.

Quote:
BTW, have you seen Pi: Faith in Chaos? It's good.

No. I'm culturally isolated. 8)

Regards,
Howard

                  
Re: Slashes in HP48 source code
Message #6 Posted by Kieron Abbott on 7 Feb 2006, 10:10 p.m.,
in response to message #5 by Howard Owen

Thanks very much! I just typed in by hand a Pythagorean triangle calculator and it worked fine. I appreciate everyone's help.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall