Post Reply 
HP41C with Rp Pico attached
12-05-2023, 03:05 PM
Post: #56
RE: HP41C with Rp Pico attached
Hi all,

Like Meindert, I have been busy with the Pico attached to the 41 (see Meinderts video some posts above), and for the last weeks I have been trying to emulate the Blinky ROM (HP-82242 IR Printer module).

I started from scratch, with just the ROM-dump of the two banks of the module, but with almost no documentation about the hardware in the module.

But, with the help of Meindert and Mike, I have more or less now a complete emulation of the hardware, emulating all flags and registers in there - enough so that I can use the "module" in a real HP-41 and print.

I have yet to attach an IR-led to the Pico, but I can send and verify the output from the module in the PC, so an IR-led is the next step.

To be able to do this, I have disassembled the ROM and "unwinded" all code to be able to understand how the code works, especially the interaction with the hardware (timers, status registers etc).
Then all hardware is emulated by the Pico in real time, the output buffer, timer clock and signaling on the FI bus, indicating buffer and timer status.

There are some peculiarities that I still don't understand - maybe some hardware and NUT experts here on the forum might help in understanding the inner working ... Wink

One such case is the usage of CXISA. The module uses two banks, and to save from switching, a lot of code is duplicated in both banks.

There is one case in bank 1 (second bank), where a table in mainframe ROM 1 is accessed (at address 0x1400).
But, instead of accessing that table directly, the code calls a subroutine, switches to bank 0, executes CXISA, swaps back to bank 1 and returns.

Code:
 6999 130014 LDI 014        # Main function table (@1400)
 699B 27C    RCR 9          # Rotate in 2 last addr digits
 699C 2951BC GSUBNC 6FA5    # CXISA from bank 0 @ 14xy

# The code jumps the the following code
# Execute CXISA from bank 0
 6FA5 00B GONC +1 6FA6
 6FA6 100 ENROM1            # Jump to bank 0

# Here we switch over to bank 0 and continue execution
 6FA7 330 CXISA
 6FA8 3EB GONC -3 6FA5

# Here we switch back to bank 1 again ...
 6FA5 00B GONC +1 6FA6
 6FA6 180 ENROM2            # Jump to bank 1

# Back in bank 1 we return and continue execution ...
 6FA7 3E0 RTN


So, instead of executing CXISA directly, 7 more instructions including two bank switches and a subroutine call is made.

Is there any logical reason for this? Or just a "why not"?

There is also a case, where an error flag is checked (during the delay between printed lines) where the status flag and keyboard is checked:

Code:
 # Printer done or key pressed ...
 6C4A 16119C GSUBNC 6758    # Get timer-value from reg 5 to A[S]
 6C4C 24C ST=1? 9           # Flag 9 clear?
 6C4D 009182 GOLNC 6002     # Yes, Sub A[X] from C[MSB] -> reg 6 and return
 6C4F 23D3E0 GSUBNC F88F    # ???????

Flag 9 is generally used in the code to indicate a printing problem - so if an error is detected - it jumps to .... "F88F" ... ?
Normally a "PRINT ERROR" is shown, but not in this case ...
My guess it that this is a forgotten "TBD" that never was fixed before launch of the module.

Any ideas or comment?

Best regards,
Thomas

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP41C with Rp Pico attached - blackjetrock - 05-31-2023, 06:27 AM
RE: HP41C with Rp Pico attached - ThomasF - 05-31-2023, 08:01 AM
RE: HP41C with Rp Pico attached - ThomasF - 06-01-2023, 05:53 AM
RE: HP41C with Rp Pico attached - ThomasF - 06-01-2023, 02:22 PM
RE: HP41C with Rp Pico attached - ThomasF - 06-22-2023, 11:31 AM
RE: HP41C with Rp Pico attached - ThomasF - 06-22-2023, 01:10 PM
RE: HP41C with Rp Pico attached - ThomasF - 06-22-2023, 08:13 PM
RE: HP41C with Rp Pico attached - ThomasF - 07-06-2023, 05:00 PM
RE: HP41C with Rp Pico attached - ThomasF - 07-06-2023, 06:41 PM
RE: HP41C with Rp Pico attached - LEDfan - 07-08-2023, 07:57 PM
RE: HP41C with Rp Pico attached - ThomasF - 07-13-2023, 07:16 AM
RE: HP41C with Rp Pico attached - ThomasF - 07-13-2023, 11:19 AM
RE: HP41C with Rp Pico attached - ThomasF - 07-25-2023, 03:07 PM
RE: HP41C with Rp Pico attached - ThomasF - 07-25-2023, 03:18 PM
RE: HP41C with Rp Pico attached - ThomasF - 07-26-2023, 11:45 AM
RE: HP41C with Rp Pico attached - ThomasF - 09-07-2023, 06:20 AM
RE: HP41C with Rp Pico attached - ThomasF - 09-07-2023, 01:48 PM
RE: HP41C with Rp Pico attached - ThomasF - 09-08-2023, 06:27 AM
RE: HP41C with Rp Pico attached - Tinue - 12-02-2023, 10:25 AM
RE: HP41C with Rp Pico attached - Tinue - 12-02-2023, 11:26 AM
RE: HP41C with Rp Pico attached - Tinue - 12-02-2023, 01:15 PM
RE: HP41C with Rp Pico attached - brouhaha - 12-02-2023, 05:25 PM
RE: HP41C with Rp Pico attached - ThomasF - 12-05-2023 03:05 PM
RE: HP41C with Rp Pico attached - PeterP - 02-22-2024, 09:23 PM
RE: HP41C with Rp Pico attached - floppy - 03-15-2024, 11:16 AM
RE: HP41C with Rp Pico attached - brouhaha - 08-07-2024, 04:24 AM



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