Keypad Details
The keypad on the MB5 is accessed by reading a byte from location $500001.
It has been wired to be an interrupt-driven device.
Whenever a key on the keypad is pressed, a level 1 autovector interrupt
is generated.
The level 1 autovector interrupt vector has been set to start
execution at location $100000.
This is the location at which a JMP instruction must be placed that
points to the interrupt handler.
.lp
The keypad generates a 4-bit value ($0-$F) corresponding to the
pressed key.
This value is read as a byte from location $500001.
It is best to mask out the higher order 4 bits of the byte
before using the value.
The mapping of values to the labels on the keypad may not be what
one would expect.
The table on the left shows the keys of the keypad.
The table on the right is the value that is returned when the key is
pressed.
Keyboard Codes
Keypad
| 1 | 2 | 3 | A |
| 4 | 5 | 6 | B |
| 7 | 8 | 9 | C |
| * | 0 | # | D |
| |
Key Codes
| 0 | 1 | 2 | 3 |
| 4 | 5 | 6 | 7 |
| 8 | 9 | A | B |
| C | D | E | F |
|