Post Reply 
Emu48 Binary to ASCII
05-16-2021, 01:22 AM
Post: #1
Emu48 Binary to ASCII
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?
Find all posts by this user
Quote this message in a reply
05-16-2021, 06:35 AM
Post: #2
RE: Emu48 Binary to ASCII
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'?

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
05-16-2021, 06:57 AM
Post: #3
RE: Emu48 Binary to ASCII
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.
Find all posts by this user
Quote this message in a reply
05-16-2021, 09:38 AM
Post: #4
RE: Emu48 Binary to ASCII
(05-16-2021 06:35 AM)Joe Horn Wrote:  What happens if you run ASCIIBIN on X10's contents instead of on 'X10'?

   
Find all posts by this user
Quote this message in a reply
05-16-2021, 09:46 AM
Post: #5
RE: Emu48 Binary to ASCII
(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!
Find all posts by this user
Quote this message in a reply
05-16-2021, 10:37 AM
Post: #6
RE: Emu48 Binary to ASCII
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.
Find all posts by this user
Quote this message in a reply
05-16-2021, 02:04 PM
Post: #7
RE: Emu48 Binary to ASCII
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-16-2021, 03:31 PM (This post was last modified: 05-16-2021 03:34 PM by MNH.)
Post: #8
RE: Emu48 Binary to ASCII
(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.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
05-16-2021, 11:41 PM
Post: #9
RE: Emu48 Binary to ASCII
(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).

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
05-16-2021, 11:51 PM
Post: #10
RE: Emu48 Binary to ASCII
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 \>>

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
05-17-2021, 12:09 AM
Post: #11
RE: Emu48 Binary to ASCII
(05-16-2021 11:41 PM)Joe Horn Wrote:  Set the XLAT option to ->255.

Thank you, Joe!
Find all posts by this user
Quote this message in a reply
05-17-2021, 12:22 AM
Post: #12
RE: Emu48 Binary to ASCII
(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!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: