I'm investigating a possible error in the IBM PCjr's I/O port address table, and I'm hoping someone with a working physical IBM PCjr would be willing to run a few short BASIC programs.
On page 2-29 of the IBM PCjr Technical Reference, the Intel 8253 timer is assigned I/O addresses 40H–47H. However, the table specifies 0 for address bit A2.
I suspect that 0 should actually be X (don't care).
If A2 is ignored, the timer's four registers should appear at two sets of addresses:
| Register |
Primary |
Alias |
| Counter 0 |
40H |
44H |
| Counter 1 |
41H |
45H |
| Counter 2 |
42H |
46H |
| Control |
43H |
47H |
If A2 must be zero, only 40H–43H would access the timer.
The motherboard schematics suggest that A2 is ignored, but I'd like to verify this on real hardware.
Test 1: Scan the I/O ports
Please enter and run the following BASIC program:
10 FOR I=50 TO 75
20 IF I=64 THEN PRINT "What happens next?"
30 PRINT I,INP(I)
40 NEXT I
This program may cause the PCjr to appear to lock up. However, I suspect that it may actually finish executing and simply leave the keyboard unresponsive.
I'd particularly appreciate an exact record of what happens:
- What does the program print? Please describe the complete output, including the port numbers and values.
- Does the program reach port 75 and display the BASIC
Ok prompt?
- Does the keyboard still accept input afterward?
- If the machine appears to freeze, at exactly what point does that happen?
Details of the results would be especially helpful.
Test 2: Read port 41H (decimal 65)
After a fresh reboot, run:
PRINT INP(65)
Record the value, then try entering another BASIC command. Does the keyboard still work?
Test 3: Read the suspected alias, 45H (decimal 69)
After another fresh reboot, run:
PRINT INP(69)
Again, record the value and check whether the keyboard still responds.
Test 4: Read both ports
After another fresh reboot, enter and run:
10 A=INP(65)
20 B=INP(69)
30 PRINT A,B
Record both values and check whether the keyboard remains functional.
Why might these programs affect the keyboard?
The PCjr's BIOS uses timer counter 1 to reconstruct serial keyboard data. Reading the counter an odd number of times may disturb its low-byte/high-byte read sequence, leaving the BIOS out of sync. The computer may continue executing instructions even though the keyboard no longer works.
In the MartyPC emulator, reading port 65 once causes the keyboard to stop responding, while reading port 69 returns 255 and leaves it working. This suggests the emulator may not implement the suspected address alias.
Important: These tests may leave the keyboard unresponsive and require a reset. Please don't run them with unsaved work. Start each test after a fresh reboot so earlier tests cannot affect the results.
If you can help, please mention which BASIC version you're using and whether your PCjr has an infrared or wired keyboard.
I'm particularly interested in whether 41H and 45H access the same timer register on an actual IBM PCjr.
Thanks!