HP Forums
Emu48 Binary to ASCII - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: Emu48 Binary to ASCII (/thread-16948.html)



Emu48 Binary to ASCII - MNH - 05-16-2021 01:22 AM

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?


RE: Emu48 Binary to ASCII - Joe Horn - 05-16-2021 06:35 AM

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'?


RE: Emu48 Binary to ASCII - 3298 - 05-16-2021 06:57 AM

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.


RE: Emu48 Binary to ASCII - MNH - 05-16-2021 09:38 AM

(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]


RE: Emu48 Binary to ASCII - MNH - 05-16-2021 09:46 AM

(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!


RE: Emu48 Binary to ASCII - MNH - 05-16-2021 10:37 AM

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.


RE: Emu48 Binary to ASCII - Eric Rechlin - 05-16-2021 02:04 PM

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.


RE: Emu48 Binary to ASCII - MNH - 05-16-2021 03:31 PM

(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.


RE: Emu48 Binary to ASCII - Joe Horn - 05-16-2021 11:41 PM

(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).


RE: Emu48 Binary to ASCII - Joe Horn - 05-16-2021 11:51 PM

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 \>>


RE: Emu48 Binary to ASCII - MNH - 05-17-2021 12:09 AM

(05-16-2021 11:41 PM)Joe Horn Wrote:  Set the XLAT option to ->255.

Thank you, Joe!


RE: Emu48 Binary to ASCII - MNH - 05-17-2021 12:22 AM

(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!