ROM Upload for the HP 48
by J.Y Avenard

Find more programs for your HP48 at: http://www.epita.fr/~avenar_j/hp


Addendum:
If you want to use the IR port of the HP48 instead of the RS232 port, simply use the ROMUPLIR.BIN instead.
(ROMUPLIR4800.BIN will set up the IR port a 4800bps instead of 2400bps)


Size: 877 bytes, Checksum: #9907h (#39175d)

This is probably the most difficult program I have ever written on an HP48.
This operation is VERY tricky.
The HP48 CPU can address only 512kB of memory. If you have ever noticed,
RAM+ROM+PORT1+PORT2 is always superior to 512kB (on the HP48SX and HP48GX).
Therefore, the Internal RAM and the extension ports have to be unconfigured to give
access to the ROM.
The main problem appears: where the ROMUpload program will run if the internal RAM
has to be removed ??... Well, check the source code (HP tools syntax), and see
how difficult it was.

1- Presentation

This program allows you to send the whole ROM of your HP48 to a computer using the
XModem(checksum) protocol.

Warning: The ROM image is owned by HP.
Any kind of distribution is prohibited by Law.
In order to use the ROM image, you MUST be the proud owner of an HP48.

2- Installation

You will need a Xmodem client as well.
With a PC, you can use the HyperTerminal from Hilgraeve.
The one provided with Windows 95 doesn't work (thank you Microsoft).
Download HyperTerminal Private Edition instead at http://www.hilgraeve.com/htpe.html

With a Mac, ZTerm is perfect (like most of the Macintosh software)

Under Unix, the Xmodem GNU package is ok (using the RX command).
But I won't explain here how it works.

3- First start

This program can be installed wherever you want in your HP48 (even in a covered port on GX).
Since it's a program (not a library), the best location is the HOME directory.
It will need 800 bytes approximately of free memory to run.
The program is designed to work in every RAM situation, even if a RAM card is merged.
In order to prevent any difficult situations, this program copies itself
into the Temporary Object Area (TOA). However, if your HP48 is already full of
temporary objects (such as big strings) and the TOA is located on both
the internal RAM and a merged card, the program won't work and you will get
the error: "Insufficient Memory".

To prevent any problems, I suggest that you first perform a warmstart
by pressing simultaneously ON and C.

---

Start the Xmodem reception (HyperTerminal, Terminal...) on your PC. (or whatever)
Configure the serial port to:
*9600 bauds
*8bits
*No parity
*No Handshake

Then start the ROMUpload program on the HP48.The HP48 serial configuration doesn't matter,
since the ROMUpload will set the correct parameters for you.

Depending on your Xmodem client, it may take up to one minute before
the upload starts. The reason is that most of the Xmodem client by default
use XModem CRC and will change for Xmodem Checksum only after three retries.

The HP48 will upload the ROM to the desktop computer.
It will take approxymately 12 minutes on an HP48G (512kB), or 6 minutes on an HP48S (256kB)
to complete the job. Once it's done, the program will return to the normal stack
with the string "Upload Succeeded".
Any case of any error, the string "Upload Failed" will be returned.

You can stop the transfer at any time, simply by pressing the ON key.

4- Using the ROM dump with an Emulator

* With X48 (Unix, PC and Mac), the result can be used as is. Just start X48 with:
x48 -rom name -initialize
Where name is the name of the ROM dump.

* With Emu48 (the best HP48 emulator ever made), you must run the CONVERT utility
first. It's very simply, just do:
With a GX ROM dump: convert name ROM.48G
With a SX ROM dump: convert name ROM.48S
Where name, as above, is the name of the ROM dump, and ROM.48G(S) is the file which
will be created by convert.
Then follow the Emu48 instructions provided with the Emu48 package.


Attention:
This program should work on ANY HP48 (version A to R).
If you've noticed any problems, please email me to: avenar_j@epita.fr