Prev: 39692 Up: Map Next: 39883
39875: Read Keyboard Port
Used by the routines at PlayMusic_WaitKey and ReadInputDevice.
Reads a row of keys, or all of them at once. The bits of the result that are set are the keys that are pressed.
Input
A Row selector (the high byte of the port address)
Output
A Keys pressed in the bottom five bits
F The zero flag is set if no key is pressed
ReadKeyboardPort 39875 OUT (253),A Output the selector to a port (this has no other effect).
39877 IN A,(254) Read the row selected by A.
39879 CPL Invert the bits.
39880 AND %00011111 Keep the five bits for the keys.
39882 RET Return.
View the equivalent code in;
Prev: 39692 Up: Map Next: 39883