Prev: 53431 Up: Map Next: 53475
53467: Read Keyboard Port
Reads the keyboard half-rows selected by A. A zero bit selects a half-row, and more than one half-row can be read at once. The keys that are pressed come back as set bits 0 to 4.
Input
A The half-rows to read, with a zero bit for each half-row
Output
A The keys pressed, in bits 0 to 4
F The zero flag is set if no key is pressed
Write the selector to port 253 which has no effect on a 48K Spectrum, then read port 254.
ReadKeyboardPort 53467 OUT (253),A Write the selector to port 253.
53469 IN A,(254) Read the keyboard.
53471 CPL Make a one bit for each key which is pressed.
53472 AND %00011111 Keep the five bits for the keys.
53474 RET Return.
View the equivalent code in;
Prev: 53431 Up: Map Next: 53475