HP Forums
Changing the XROM Number of a ROM - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Changing the XROM Number of a ROM (/thread-21592.html)



Changing the XROM Number of a ROM - BitWiz - 04-12-2024 01:22 AM

I am in the process of getting everything all setup for when my NoV-64D arrives and I have encountered a small problem.

Some of the ROMs that I have selected share XROM Numbers:

NOV CHAP and ZENROM both share XROM #5.
AMX_OX/X+ and HP-16C Emulator both share XROM #16.

I was able to find the source for the NOV CHAP ROM in .XLS for, once I figure out how to compile an XLS I will be able to change the XROM umber for that. I could also change the XROM number for the ZENROM if I could find the source and if I decided to put it in the NoV-64D flash space instead of the actual ZENROM that I am currently using.

I was unable to find the source for either the AMC_OS/X+ or HP-16C Emulator ROMS.

Does anyone know where I can find the source for those?

Does anyone have a utility that can change the XROM numbers of a binary or .ROM file without having to disassemble and reassemble it?

Thank you,

Mike


RE: Changing the XROM Number of a ROM - Sylvain Cote - 04-12-2024 05:20 AM

The first 10-bit word of a ROM is the XROM value.
In the 16-bit ROM format each 10-bit instruction takes 16-bit.
So, in the ZENROM.ROM file, the first two bytes is in hex: 00 05
Directly change in the ROM file the 05 value to what you want.
The checksum value at the end of the ROM file will no longer be valid but the ROM will still works because the 41OS does not validate the checksum.
WARNING: changing the XROM value of a ROM image will render your programs in compiled mode (raw file) incompatible with the outside world.


RE: Changing the XROM Number of a ROM - BitWiz - 04-12-2024 05:31 AM

Sylvain,

Thank you.

Would any internal calls in the ROM to other functions within the ROM need to be changed?

Whether M-Code or Focal?

Thank you again,

Mike


RE: Changing the XROM Number of a ROM - Sylvain Cote - 04-12-2024 12:00 PM

(04-12-2024 05:31 AM)BitWiz Wrote:  Would any internal calls in the ROM to other functions within the ROM need to be changed?
Whether M-Code or Focal?
AFAIK the XROM ID is a FOCAL issue, more precisely it is related to a XEQ function call that has been converted to a XROM function call to a global label in ROM. If it is a MCode only ROM, you should be ok, if the ROM has FOCAL code, you must patch all the XROM instructions that calls one of the ROM global label or one of the module function. I will double check on my side and come back if I found anything else.4

edit 1: Of course changing a XROM ID of a ROM has a direct impact in a FOCAL program.
A XEQ that calls a ROM global label or MCode function that is inserted in a program is converted into a XROM call.

edit 2: 1st paragraph update.


RE: Changing the XROM Number of a ROM - BitWiz - 04-13-2024 08:33 PM

One last question on this subject.

In banked ROMS (like the HEPAX or OSX ROMS) do I need to change the XROM number in the first word of each bank?

Thank again,

Mike


RE: Changing the XROM Number of a ROM - ThomasF - 04-13-2024 09:44 PM

(04-13-2024 08:33 PM)BitWiz Wrote:  One last question on this subject.

In banked ROMS (like the HEPAX or OSX ROMS) do I need to change the XROM number in the first word of each bank?

Thank again,

Mike

Hi Mike,

No, in a bank switched module, only the first bank contains the XROM ID.
None of the other banks are "visible" (to the OS) so it is only the first bank that contains the ID and the FAT table for all included functions.
Typical the first two words are zero in the other banks.

Cheers,
Thomas


RE: Changing the XROM Number of a ROM - Ángel Martin - 04-14-2024 06:29 AM

(04-12-2024 05:31 AM)BitWiz Wrote:  Would any internal calls in the ROM to other functions within the ROM need to be changed?
Whether M-Code or Focal?

The answer to that is - it depends on the actual MCODE. Sometimes the XROM# is used for housekeeping or for advanced features, so changing it does have a vital impact (negative). This is the case with many of my ROMS, and yes this also rules for the auxiliary banks in bank-switched configurations.

So assume the answer is always YES to avoid issues down the road.

Cheers,
ÁM