|Re: HP-IL on HP-41 questions|
Message #5 Posted by Khanh-Dang Nguyen Thu-Lam on 1 Feb 2009, 6:29 a.m.,
in response to message #4 by Patrice
I think I've just found how this printer switch works.
When the printer switch is enable, the HPIL Printer ROM is at page 6. Thus, you can use all its commands as expected. This printer also defines some interrupt vectors: both the so-called "Pause loop" interrupt vector and the "I/O service" interrupt vector are defined to the same subroutine. I'm not sure when these interrupt vectors are precisely executed by the system. They may check for a HPIL printer or so.
Now, the interesting part is when the printer switch is disable. This forces the HPIL Printer ROM to be at page 4. Page 4 is normally reserved for the service ROMS. ROMs at page 4 can take over the system. (See "ZENROM manual", page 97) I guess ROMs at page 4 have no FAT table and their first executable word is directly at address 000 of the ROM. Now, what happens when the Printer ROM is at page 4?
Here is the first bytes of this ROM (remember ROM bytes are 10-bit). Interpretation follows.
When the ROM is at page 6 (printer switch is on), the ROM is considered as a normal ROM, with a FAT table. So, these first bytes shall be interpreted as:
000: 01D ; XROM 29 (This is the ROM ID)
001: 01B ; FCNS 27 (There is 27 commands in this ROM)
002: 0071BB ; DEFP4K 7BB (This is the first "command" of the ROM
; it points to the "-PRINTER 2E" message)
When the ROM is at page 4 (printer switch is off), the bytes remain the same, but they are to be interpreted as executable code:
000: 01D01B ; GOLC 0607
003: 007 ; GOC +0
004: 1BB ; GONC +55 403A
03A: 3E0 ; RTN
As the carry is not set when these bytes are executed, they basically do a RTN. So, I guess, when the system do a GSUB 4000 (question: when does this happen?), nothing happens.
I am not really sure about all I've just written but it seems to me quite convincing.