The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

ROM Images from your own programs (long)
Message #1 Posted by Miki Mihajlovic on 21 Dec 2003, 8:13 p.m.

While ago I asked how to create a ROM image from your own FOCAL code and that steered an intensive discussion with (for me) lot of great ideas. My goal was to be able to create my own ROM image file from bunch of regular application programs and put them into Clonix, once it becomes available. Nevertheless, even for the use with 41C emulators one can keep the similar programs in a sort of library without the need for additional file housekeeping on a PC and to save the physical RAM space of the machine.

Although some people might prefer using (I am sure great) SDK41 and getting to the bottom of the process involved and understanding page switching, optimizing etc. myself not being a 'system' guy, I was looking for a simple and effective way of creating these ROM images with tools available (for free) and without spending too much time doing it. So I thought that I can share the workflow I used with the rest of enthusiasts. I am sure that I will not be telling much to the power users who frequent this forum but for the rest of us that need a bit of help with these kinds of things it might be helpful.

First here is the list of things you need to have:

- EMU41 from J.F Garnier
- hp41uc from Leo Duran
- Eramco ES-41 ROM image. You can get it from Warren's (other great HP)site.
- If you are using V41 or want to burn images into Clonix you need some kind of utility to convert BIN (packed format) files to ROM (unpacked) files. I used bin2rom kindly provided by Diego Diaz (thanks Diego). I believe that SDS-II by HP can do the same thing.
- Your FOCAL code on PC.

(1) If you have your code in TXT format compile it to RAW format using hp41uc.

(2) Use all the RAW files to build a LIF file (system) since EMU41 can read these through virtual HP-IL interface. Building a LIF file is easy by using:

hp41uc /r=.\dir\*.raw /l=HPIL.LIF

This will put all of your programs into a single file we here call HPIL.LIF (can be any name) and create a proper FAT from file headers.

(3) Convert Eramco ES41L.ROM and ES41U.ROM to BIN files using clbin41 supplied with EMU41, then just merge these two BIN files into a single one (copy /b es41l.bin+es41u.bin es41.bin) to simplify things in EMU41.INI.

(4) To setup EMU41.INI we can use the simplest configuration needed. This comes default with EMU41 (which gives you 41CV). Here is the INI file I used:

[MODULES]
; page size filename
0 12 rom41cv.bin
6 4 prter2e.bin
7 4 hpil1h.bin
12 4 es41.bin
14 8 MLDLRAM.DAT
[DEVICES]
DISPLAY
HDRIVE1 HPIL.LIF
;FDRIVE1
DOSLINK
PRINTER

(5) Run EMU41 and issue DIR command. This will list all the files on LIF filesystem. As a test case I used files from the Geometry solutions book so I got something like this:

CIRTGNT
DISTLNS
...
VNOTCH

(6) Now, load all these into EMU41 RAM by specifying the file name in alpha register eg. [ALPHA]CIRTGNT[ALPHA] and issuing XEQ "READP". Repeat for all the file names from LIF filesystem. Keep track about the remaining free registers in RAM, since they all might not fit in.

(7) Once you have them all in RAM, or as many as you can squeeze in you need to initialize the RAM BOX. First clear it XEQ "CLRSU", and then initialize the program block. To do that you will put the name for your future ROM IMAGE in alpha register. This is the title name for the ROM image like "MATH 1C" or "STAT 1B". RAM BOX also needs to know which block (4k page number) you want your programs to write to. Blocks correspond to expansion port numbers where lower page has positive numbers and upper page has negative numbers. Since our MLDLRAM.DAT file is defined to be in port 4 we have to use that number here. Put it in X register and issue INIPRGM command. It will then ask you what XROM ID number you want to assign to your ROM image. I used 18 (from plotter module since I don't use it). To summarize:

[ALPHA]GEOMETRY 1A[ALPHA]
4
XEQ INIPRGM
018

(8) We are ready now to load programs into RAM box. It is a good idea that you exit EMU41 at this point (by pressing F1 key) just to make sure it saves your current status in case something freezes later.

(9) Programs are loaded into RSU by their global label names which are NOT necessarily same as the file names from LIF filesystem. Easiest is to issue CAT 1 command and write down the global labels. Make sure the program pointer is in the main memory, not in ROM by PACKING at this time. Load the programs by using LOADP command. It will ask for the program name that you type in. I found it necessary to delete the program from main memory (by CLP) after it was loaded to RSU. I am not sure why but if I didn't do this EMU41 would freeze when loading the next program.

(10) The programs in RSU will have XROM 18,00; 18,01 etc. sequentially assigned, no need to worry about that. Just have to make sure that we do not have more than 64 global labels per single image.

(11) Once all the programs are in RSU exit EMU41 and rename the MLDLRAM.DAT to MYROMFILE.BIN. To convert it to ROM image use the appropriate conversion utility (bin2rom or SDS-II).

And that's it.

You can use HEPAX instead of Eramco to accomplish the same thing but my problem with HEPAX was that it automatically assigns the XROM ID number to the image file without allowing you a choice.

I am sure that this workflow is not a perfect one and that different, smarter than me, people will improve it, but it works and it doesn't take a long to package all your files into appropriate images.

Edited: 22 Dec 2003, 6:34 p.m.

      
Re: ROM Images from your own programs (long)
Message #2 Posted by Diego Diaz on 23 Dec 2003, 10:21 a.m.,
in response to message #1 by Miki Mihajlovic

Hi,

I've made a stop to place my ad and have a look... (still on holidays ;-), will need some time to fully understand the whole process, I'll print it and mail you back to see if it can be automatised, in order to simplify some steps.

Anyhow it's a nice job!!

Season's Greetings

Diego.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall