NEC PC Programmers Reference/PC-98xx Series Programmers Reference/Interrupt 0x18 - Keyboard
The Keyboard BIOS emits an Interrupt 0x9 when key is pressed. Keyboard data may be treated by invoking INT 0x18.
How BIOS Manages Keys
editBIOS maintains an array of data ("keyboard status table"), with a bit for each key. When key is down, bit is 1; when up, bit is 0. When key is pressed, index of key in input status array is combined with code for SHIFT status to produce key scan code (which is how programs recognize keys).
PC-98 Keyboard BIOS is IBM-compliant.
List of Key Access Commands
editAH | Command | Purpose | Use |
---|---|---|---|
0x1 | Sense First Key | Queries keyboard for keypresses. Returns key at back of buffer. | Returns
|
0x2 | Examine Modifier Keys | Returns status of key modifiers (SHIFT, CTRL, GRPH, CAPSLOCK, KANA) | Returns modifier status byte in AL
|
0x3 | Initialize Keyboard | Install built-in keyboard driver interface. Sets aside memory for BIOS use of keyboard; resets uPD8251A. | |
0x4 | Get Key Group Status | Queries the keyboard state table for the immediate state of a set of keys. Returns the byte for the key group requested, which in turn can be masked with logical AND to find the state of individual keys. |
Returns
|
0x5 | Sense Last Key | Queries keyboard for keypresses. Returns key at front of buffer. | Returns
|
0x6 | Init Keyboard Buffer / Pending Keys Clear | Sets up keyboard buffer. Calling this will clear the buffer. | |
0x7 | Handle First Key | Get the first key pressed not yet handled and removes it from the buffer. |
Returns
|
0x8 | Handle Last Key | Gets the last key pressed and removes it from the buffer. |
Returns
|
0x9 | Simulate Key Press | Creates a simulated keypress by filling the keyboard buffer with designated data. |
Returns
|