HP Forums

Full Version: Emu48 Binary to ASCII
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having difficulties converting a binary file to an ASCII format for the purpose of documenting the program. I'm using ASCII to Binary Converter 2.0 by Eric Rechlin, John H Meyers, and Christoph Gießelink.
My steps are as follows:

(1) Create a program \<< 10 * \>>; store it in variable 'X10.'
(2) Load ASCIIBIN.48; store it in variable 'ASCIIBIN.'
(3) Put 'X10' on the stack and execute 'ASCIIBIN.'

I get "%%HP: T(1)A(D)F(.);■'X10'" on the stack. Where is \<< 10 * \>>? Why is there a line feed character in the resulting string?
It looks like it's encoding the name object 'X10' instead of its contents. What happens if you run ASCIIBIN on X10's contents instead of on 'X10'?
The linefeed is the final character of the header, which otherwise contains the "magic value" %%HP at the start, as well as three settings that affect parsing (trigraph translation, angle mode, fraction mark; the characters in parentheses encode the setting values).
The part after the linefeed is the actual object, in this case: 'X10', since you requested that variable name to be converted. There is no \<< 10 * \>> because that's not part of the variable name, and you didn't do a RCL on that before converting.
(05-16-2021 06:35 AM)Joe Horn Wrote: [ -> ]What happens if you run ASCIIBIN on X10's contents instead of on 'X10'?

[attachment=9476]
(05-16-2021 06:57 AM)3298 Wrote: [ -> ]There is no \<< 10 * \>> because that's not part of the variable name, and you didn't do a RCL on that before converting.

This time I did a RCL, and I did get \<< 10 * \>>. Thank you!
If I want to clean up

"%%HP: T(1)A(D)F(.);■
\<< 10 *■
\>>"

so it can be posted on a forum, or saved as a text file, I have to remove the quotation marks and the line feed characters. Also, replace << with \<< and >> with \>>. I thought I saw some code to do that on comp.sys.hp48.
The tool uses the current ASCII translation mode, so you'll want to change that from 1 to 3 (in right-shift-1 [I/O], Transfer, Xlat) to handle the << and >> characters.
(05-16-2021 02:04 PM)Eric Rechlin Wrote: [ -> ]The tool uses the current ASCII translation mode, so you'll want to change that from 1 to 3 (in right-shift-1 [I/O], Transfer, Xlat) to handle the << and >> characters.

Please see the attached image of what I currently have set. I don't understand how to set XLAT to 3; it isn't one of the choices on the XLAT drop-down list.
(05-16-2021 03:31 PM)MNH Wrote: [ -> ]
(05-16-2021 02:04 PM)Eric Rechlin Wrote: [ -> ]The tool uses the current ASCII translation mode, so you'll want to change that from 1 to 3 (in right-shift-1 [I/O], Transfer, Xlat) to handle the << and >> characters.

Please see the attached image of what I currently have set. I don't understand how to set XLAT to 3; it isn't one of the choices on the XLAT drop-down list.

Set the XLAT option to ->255. Alternative method: Executing 3 TRANSIO will do it (benefit: it's programmable). Keyboard access on the 48G/GX: Left-shift 1 (I/O), IOPAR, 3, TRAN (the last soft menu key).
If all you want is to do is translate an RPL program into postable text, these tiny programs will do it:

HP 48 (S or G series): \<< \->STR 3. TRANSIO #2FEDDh SYSEVAL \>>
HP 50g: \<< \->STR 3. TRANSIO #2F34Eh SYSEVAL \>>
(05-16-2021 11:41 PM)Joe Horn Wrote: [ -> ]Set the XLAT option to ->255.

Thank you, Joe!
(05-16-2021 11:51 PM)Joe Horn Wrote: [ -> ]HP 48 (S or G series): \<< \->STR 3. TRANSIO #2FEDDh SYSEVAL \>>
HP 50g: \<< \->STR 3. TRANSIO #2F34Eh SYSEVAL \>>

Thank you, Joe!
Reference URL's