HP-41 XROM Numbers: What do they mean?

Back to main page | Email me at: Gene!


The article presented below was originally written by Richard Nelson, founder of PPC way back in 1974. It appeared in the V1N1 CHHU Chronicle, October 1984. Richard presently works for Educalc in California. I have made a couple of corrections that were referenced in later editions of the CHHU Chronicle.
If you have an HP applications module plugged into one of your HP-41 ports, can you press a few keys and determine its ROM number? Do you know what the ROM number is and why it is important? If you are not sure, read on. This article will describe the standard HP-41 eXternal Read Only Memory, XROM, numbering system. XROM numbers associated with synthetic instructions will not be covered - perhaps in a future article?

The HP-41C, CV, and CX have the feature of four ports that may be used to plug in a wide variety of software and hardware plug-ins. the software plug-ins (modules) are called ROMs, (Read Only Memory) and each port may hold a ROM with a capacity of either 4,000 (4K) or 8,000 (8K) "words" that make up the program instructions. The four ports are numbered one through four and the HP-41 operating system scans these ports in order. Whenever a ROM module is plugged into a port, the machine has to know that the module is present, and which one it is.

There are nearly 100 different ROMs (Note: That was as of October 1984. More were produced later. -Gene) that could be purchased and plugged into the four HP-41 ports. The possible combination of 100 ROMs taken four at a time requires an identification system that is simple and fast. Here is how HP solved the identity problem.

Each ROM is given a number. This number is located in a particular place in the ROM so the HP-41 operating system can "ask" each ROM its number. This number may range from 0 to 31, with 0 not used. The functions in the ROM are numbered from 0 to 63 for each 4K block. Obviously, with 100 or more ROMs available, there must be duplicate ROM numbers. HP, in fact, has used number 19 for four different ROMs - the Aviation X, Clinical Laboratory X, the Securities X and the Structural Analysis X.

If you plug in two ROMs with the same ROM number, the HP-41 may get confused. In general, however, the ROM in the lowest numbered port will be used. HP marked the number 19 ROMs with an X on the label and advises the user not to have two "X" marked ROMs in their machine at the same time. The avoidance of duplicate ROMs is one reason to be aware of the ROM number. This is not always obvious.

Suppose that one ROM has an "add" operation as function number 6, and another has a "subtract" operation as function number 6. If you don't pay attention, you will think that you are adding when in reality you are subtracting because the module with the subtract operation is in a lower numbered port.

The use of the XROM number is likened to a list of names. The list may be in random order, but each line contains a name that is numbered. You may look at the list for a given name or you may go to the name if you know the corresponding line number. For a list of 99 names, a two digit line number is adequate. The names themselves may be 30 or more characters each. The XROM number for the functions in the ROM is like the line number of the name list. The names correspond to the program names in the ROM. The form of the XROM number is NN, nn, where NN is the ROM number 1 to 31, and nn is the function number 0 to 63. An XROM number of 44, 24 would not be a valid XROM number but could represent a synthetic function. An XROM number of 73, 82 could not exist because the internal XROM program of the operating system does not accommodate NN or nn above the value of 63.

Function number 0 in each module is usually used for a special purpose. When the operating system does a catalog 2, it calls function 0 of each module. The information function 0 provides is called the ROM header. This information is shown in the HP-41 display and includes the ROM name and revision. An 8K module is actually two 4K modules and some configurations have two headers while others have one with the first function of the second 4K a valid function (Note: The PPC ROM is one such beast. Routine SR of the second 4K module can show up this way. -GW). Whenever a catalog 2 is displayed or printed, the functions are listed in numerical order with the header as XROM NN,00, the first function NN, 01, the second function NN, 02, etc.

The XROM number is what is actually placed in a program line when you use a ROM function in your program. This is similar to referring to a person on the name list by using their number. The reason for doing this is to conserve program memory and increase the search speed when the program is run. The most important consideration is the situation where you have removed the ROM that contains a function that is called out in one of your programs. If you use a ROM function called CKBOOK, for example, to balance your check book and you key XEQ CKBOOK as a program line, you will see XROM CKBOOK entered into program memory. If the module containing CKBOOK is removed from its port and you review the program line, you will see XROM NN,nn. If the module is not present, the HP-41 can't ask the ROM the function name (Label) and only the XROM number is available.

The second important reason to understand XROM numbers is to recognize functions that are used in programs in modules that have been removed from the HP-41 system. This is especially important if the program is listed. Every ROM module that HP makes has a ROM number. Custom ROMs may have any number, although HP recommends 21 and 31. The most famous custom ROM HP has made for the HP-41 is the PPC ROM which uses ROM numbers 10 and 20. ROM 10 is the same number as the HP Games ROM and many users were confused because they thought they were running programs in the PPC ROM and they really were running programs in the Games ROM. They would unplug the ROMs and sometimes they got the results they expected. This was very confusing because they didn't realize they had two sets of programs in the machine with the same XROM numbers.

The XROM number is also used for Key Assignments, again to efficiently use memory. Each register is 7 bytes of memory. Two key assignments may be stored in each register. If the full label length of 7 characters were used, only one key assignment per register would be possible. For more details on XROM numbers, you can review the HP-41 owners manual, especially Appendix H in the HP-41CX manual.

At the beginning of this article, I asked a question. Don't you hate authors who ask questions and then don't answer them? If you want to know the ROM number of a ROM plugged into the HP-41, do a catalog 2 and pick a function that is in the ROM. Assign that function to a key. Press and hold down that key in USER mode with that ROM module removed. The XROM number of the function will be displayed. The first two digits will be the ROM number.

The HP-41 XROM number system is not well known by most HP-41 users. Understanding XROM numbers is important. Suppose you press a key and the display shows NONEXISTENT, or you try to key up a program and you find XROM 29,05 in the listing or you run a program and today's results are different from the last time you ran the same program, or you want to write a program for a friend who has a printer and you don't. All of these situations could be immediately recognized as "missing" functions as indicated by the XROM numbers. It is quite possible to create any XROM number you wish and this capability would allow you to write programs and enter instructions for modules that you don't even own. You can write programs to use a printer even if you don't own one.

A good reference book would be one that would list every HP-41 function, is description, its module, and its XROM number. The "table" would contain thousands of entries and should be sorted to facilitate looking up a function by module, XROM, or name. I'm sure someone is compiling such a list and when it is finished, we will all learn a little more about HP's XROM numbers.


That's it. Enjoy!