Hi all,
I'm looking for documentation about the *.ROM and *.MOD file formats (HP-41 ROM image files). Anyone have a link to byte-by-byte explanations of these?
Thanks,
- Thomas
*.ROM and *.MOD file format documentation?
|
02-04-2006, 01:49 PM
Hi all,
I'm looking for documentation about the *.ROM and *.MOD file formats (HP-41 ROM image files). Anyone have a link to byte-by-byte explanations of these? - Thomas
02-04-2006, 02:16 PM
The .ROM file format is documented in SDK41 over at TOS.
02-05-2006, 08:01 AM
The .ROM format is very simple. It is 16 bits for each 10 bit word exactly as they appear in the rom. The upper 6 bits are set to zero. So a 4Kword rom takes 8KB in a PC .ROM binary file. The largest 16 bit word is 03FF just as the largest 10 bit word is 3FF. Open a .ROM file in a hex editor. To my knowledge the .MOD format has not been released. The .r41 format (found here: ftp://ftp.math.jyu.fi/pub/hpil/swap/swap09/ ) is more complex as it packs 4 words into 5 bytes. Best
02-05-2006, 08:11 AM
Thanks Doug! - Thomas
02-05-2006, 12:32 PM
Hi Thomas, I don't work with user code directly in rom much, the reason being that the HP41C COPY function will pull any rom user code into ram and MLDL will write user code to romram. I just develop in ram. Didn't look it up so this may be wrong/incomplete: 1) Each new line: the first byte has bit 8 set (so it is 1xx). 2) At the .END. bit 9 is set (2xx). I have to look this up. 3) There are two header words before each user code program to implement COPY and PRIVATE. 4) The entry point/s is at a global label. 5) Jumps/executes distances are in words. They are always precompiled (duh, guess i didn't need to say that).Programs run backwards from in ram so the direction bits are switched. The global chain is still intact as it is needed for COPY. Best
Edited: 5 Feb 2006, 12:51 p.m.
02-05-2006, 02:20 PM
I stared at a couple of ROM dumps for a couple of hours, and here's what I found. It seems pretty straightforward. I don't care about the "mystery" blocks (Doug mentioned they are for COPY and PRIVATE), and the details of GTO/XEQ offsets and the global chain are not important for what I plan to do either (when Free42 imports HP41/42 user code, it translates it to its own internal format and the specifics of offsets etc. are unceremoniously discarded). Thanks again for your help -- looks like I'm good to go! :-) - Thomas
0000: (1 word) ROM number
Edited: 5 Feb 2006, 2:27 p.m.
02-05-2006, 10:29 PM
Yes, it looks like you have it! Keep in mind however that the first line of a program does not have to be a global. The 2 word header for user code program, used by COPY: 0000 Number of 7 byte registers required to hold the program. 0001 Number of bytes that go into the first 7 byte register so that all the other 7 byte registers are full. Format is 2b0 (or 3b0 for priv) where 0 < b < 8. 3E0 = RTN, usually used at entry to first function (rom name). Although many times HP don't waste the word as rom name is not supposed to be executed. So it could be anything.
Edited: 5 Feb 2006, 11:19 p.m.
02-06-2006, 01:39 PM
I don't know if it's any use, but my LIF Utilities for Linux include programs to look at an HP41 ROM file (as saved on floppy by most MLDL boxes), and to catalogue the functions in a ROM. I am not sure whether .ROM and .MOD files are anything like these, but if so, you might find the comments in the source code to be of interest.
02-07-2006, 09:03 PM
Thanks to all for helping me with this! - Thomas
02-07-2006, 09:42 PM
I wondered what you were up to with the 41C rom images. Sounds really useful! I imagine these would be loadable into HP-42X with Hrast's RAW42.EXE. Unfortunately, at least one program with 42S specific functions does not work, and actually crashes my 48gx. How similar is the raw fromat for Emu42 and Free42 to the P41 raw format?
Regards,
02-08-2006, 10:59 AM
Hmm, if you have a raw file with HP-42S code, and it crashes your 48 when you run it under HP42X, it sounds like you need to send Hrast a bug report. BTW, does it work when you load it in Free42 or Emu42? - Thomas
Edited: 8 Feb 2006, 12:00 p.m.
02-09-2006, 06:27 AM
I don't know how a real 42S (or a hardware-level emulator like HP-42X and Emu42) will react to that kind of thing, or to synthetic instructions. It might crash. From what I remember from a HP42S ROM code disassembly, an unknown XROM will cause a "Machine Reset". I didn't try, although it would be easy using the built-in memory editor. It may not be the case with HP42X, as Hrast is an expert in ROM code patch :-) J-F
02-09-2006, 07:41 AM
It may not be the case with HP42X, as Hrast is an expert in ROM code patch :-) Thanks J-F, but it will do "Machine Reset" or something like that because I haven't patched this :-)
02-09-2006, 12:12 PM
Hi, Thomas; part of what you have already observed is described in 'HP41 MCODE For Beginners', availble with the MoHPC DVD/CD Set. And there is more in there, a lot more... It´s fairly worth reading. Cheers. Luiz (Brazil)
02-09-2006, 02:31 PM
Thanks for the tip, Luiz -- it hadn't occurred to me to look there, but now that you mention it, machine code and ROM layout are topics that seem to go hand in hand! I don't look at those CDs enough. :-) - Thomas |
« Next Oldest | Next Newest »
|