Post Reply 
HP 41CX/Swiss Micros DM41X and XROM
08-04-2021, 01:26 PM
Post: #1
HP 41CX/Swiss Micros DM41X and XROM
To make sure that I am understanding correctly: is XROM a place holder, which allows programs to be transferred to calculators which do or do not have the Math ROM?

For example: to calculate tanh(x+1):

01 LBL^SAMPLE
02 1
03 +
04 XROM 1,35
05 END

I am to assume that a program like this would only work with calculators containing the Math ROM.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-04-2021, 02:01 PM
Post: #2
RE: HP 41CX/Swiss Micros DM41X and XROM
(08-04-2021 01:26 PM)Eddie W. Shore Wrote:  To make sure that I am understanding correctly: is XROM a place holder, which allows programs to be transferred to calculators which do or do not have the Math ROM?

For example: to calculate tanh(x+1):

01 LBL^SAMPLE
02 1
03 +
04 XROM 1,35
05 END

I am to assume that a program like this would only work with calculators containing the Math ROM.

That's right. When you insert a ROM-based function into a program, it really only inserts the XROM instruction, in this case, it is the 35th function in a module with ROM ID=1. When the MATH ROM is installed, it provides the text name "TANH" for you to see in PRGM mode, but when it is not installed, you can only see the underlying XROM 1,35.

Also, note that the program does not care which ROM is installed, it will still use the 35th function in the first (lowest port/page) module that has ROM ID=1. So if you entered the above program with the MATH module installed (and line 04 would appear as TANHX), but then later removed that and installed EDDIE'S ROM, which had ROM ID=1 and that had functions in it named FN01, FN02...FN35, and you entered PRGM mode, line 4 would appear as FN35 (and would execute what that function did, and not execute TANH as that code is not installed)

As there are only a limited (00-31) number of ROM ID's, HP was careful to select IDs for the ROMs they made, using judgement of which applications were unlikely to be installed by the same user at the same time, so there would be no collision of ROM ID instructions.

HP did however create several ROMs with the same ROM ID, again making some informed guess of which would not be needed at the same time, and it labeled these modules with a trailing "X" in the name of the ROM, such as "AVIATION X" and "SECURITIES X" (which both use ROM ID=19), guessing that no users would ever need both of these modules inserted at the same time, nor would they write any single programs which needed functions from both modules.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-04-2021, 02:01 PM
Post: #3
RE: HP 41CX/Swiss Micros DM41X and XROM
Yes, XROM is a way to display instructions when the related module providing the instruction name is not present. And yes you need the appropriate module installed in the 41 to execute XROM instructions.

See HP-41C XROM Numbers from the MoHPC HP-41C Software Library page.
Find all posts by this user
Quote this message in a reply
08-04-2021, 03:45 PM (This post was last modified: 08-04-2021 03:48 PM by Sylvain Cote.)
Post: #4
RE: HP 41CX/Swiss Micros DM41X and XROM
To be more precise, when you type XEQ "TANH", the 41OS first search for that function internally, then go over each modules and when found insert the ROM ID and the Function table location in a 2 bytes entry in the HP-41.
Now if you remove the module and insert another module who has the same ROM ID (01) and has has least 36 functions, the 41 will call that function whatever it is called, like LBL "BOOM" (ID=35) of "GAME9" ROM (ID=1) [just in case, that ROM does not exist]
Sylvain

PS: The 2 bytes entry is defined like this: XROM preamble (22 or 10110) followed by the ROM-ID (0..31 or 00000..11111) followed by the FNC-ID (0..63 or 000000..111111).
So in this case
Code:
TANH function (ID=35) of the Math  ROM (ID=01) gives: 22 01 35 → 10110 00001 100011 → 10110000 01100011 → A0 63
BOOM function (ID=35) of the GAME9 ROM (ID=01) gives: 22 01 35 → 10110 00001 100011 → 10110000 01100011 → A0 63

Edit: Arrgg, I started to reply at 9h45, something happened, finally I post it 2h later and for sure Robert answered that one long before me.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)