Re: converting stored HP-48SX programs to run on HP-50g Message #2 Posted by James M. Prange (Michigan) on 6 Nov 2007, 4:56 a.m., in response to message #1 by Grant Nixon
Are these UserRPL objects?
Do you have a 48 series (48SX, 48S, 48GX, 48G, or 48G+) available?
Which operating system are you running on your computer?
I haven't run through the following procedures step-by-step, but I believe
that they'll work.
Quote:
I would like to convert my archived HP-48SX RPL files/diretories such that I
can store them on the HP-50g. So, my problem is two-fold:
(1) I must extract variables from the HP-48 binary format and
You need source code, as you'd get from a Kermit "ASCII" transfer. If the
files are from binary transfers or the ARCHIVE command, then you'll need to
decompile them to source code.
UserRPL objects can be decompiled on the calculator itself (of the series that
compiled them in the first place, that is). Libraries and anything that
contains SysRPL or assembly language code are more complicated to decompile,
particularly for the 48 series. For now, I'll assume that your files are
UserRPL.
If the SYSEVAL command is used in a program, then you should check for a
changed entry point. The
cross-reference files
are useful for this.
Most 48 series UserRPL programs (recompiled from source code) will run just
fine in a 49 series, but it's possible that a few commands may run
differently, particularly if the 49 series' more complicated CAS gets
involved.
If you have a 48 series available, then this could be as simple as downloading them
to the 48 series, uploading them again using Kermit ASCII or Conn4x's "text"
mode, and checking for any SYSEVAL sequences.
But if the files are large, then downloading and uploading again at 9600bps could
take a lot of time, and you might not even have a 48 series available.
Assuming that you're running a fairly recent version of MS Windows, I suggest
using an emulator.
You could use Emu48, in which case
you'd need to convert a 48 series ROM image to a ROM file that Emu48 can use.
Various publicly released ROM versions for the 48 series are available at
http://www.hpcalc.org/hp48/pc/emulators/.
Or you can install Debug4x, which
includes a version of Emu48 together with the required ROM files and .KML
scripts. If I recall correctly, it doesn't include the files to emulate a 48S
series, but a 48G series should work just fine for these purposes. I suppose
that if you really wanted to emulate a 48S series, you could add a .KML file
for it (several should be available at hpcalc.org) and a 48S ROM file
(converted from a ROM image).
Okay, assuming that you have a 48 series emulator working, import the
binary-transferred file to it. To convert it to a source code string, I
suggest installing the ASCII
to Binary Converter (it also does binary to ASCII conversions) on the
emulator. Be sure to use the ASCIIBIN.48 (not ASCIIBIN.49) file with the 48
series emulator. I suggest using translation mode 3, that is, execute 3
TRANSIO before using the translator. This should give you a source code string
on the stack, which you can export to a plain text file.
Don't forget to check for SYSEVAL sequences. You can edit the source code file
with any text editor (even MS Notepad will work). A "word processor" should
also work, as long as you're careful to save the file as plain text.
Quote:
(2), I must find a way to convert them such that I can download and run them
on my new 50g.
The "conversion" would be merely compiling the source code on a 49 series. But
when downloading to the 49 series, you'll probably want to have it in
approximate mode, so that any integer-valued "real numbers" from the 48 series
will be compiled as reals, instead of being compiled as zints (exact
integers), a new object type available on the 49 series.
You could use Conn4x to download the source code files to the 50g.
Or you could copy them to an MMC or SD card and transfer them from the card to
the calculator. However, the calculator does only binary transfers with the
card, so you'll get a source code string instead of a compiled object. I
suggest using my ASCII on
SD programs to convert between source code and compiled object, but
ASCIIBIN.49 may work as well (or even better, for all that I know) for you.
Note that my ASCII on SD programs were written specifically for SD card
transfers, and include SYSEVAL sequences that would very likely corrupt memory
on a 48 series calculator or emulator. They should be used only on a 49 series
calculator or emulator.
And of course, the final step would be trying out your programs on the 50g.
Post again if you have any questions or problems.
Regards, James
Edited: 6 Nov 2007, 5:25 a.m.
|