Specifications

Legacy BIOS References
159
INT 0x09 - Keyboard
This INT must be supported. It is called on every make or break keystroke. The 32-
byte buffer starting at 40:1E is updated at the address pointed by the keyboard-buffer
tail pointer. The keyboard-buffer tail pointer at memory location 40:1C is incremented
by 2 unless it extends past the keyboard-buffer, in which case it wraps. When a key is
read, the keyboard-buffer head pointer at memory location 40:1A is incremented by 2
unless it extends pass the keyboard-buffer, in which case it wraps. Special keys such as
CTRL, ALT, or Shift update the status at memory location 40:17, 40:18 and 40:96. A
CTRL-ALT-DELETE key sequence sets the reset flag at memory location 40:72 to 0x1234
and jumps to the reset vector.
Pressing the Pause key causes the interrupt handler to loop until a valid ASCII keystroke
occurs.
Pressing the Print Screen key causes an INT 0x05 to be issued.
A CTRL-BREAK sequence causes INT 0x1B to be issued.
Pressing the SysReq key causes INT 0x15 Function 0x85 (System Request Key Pressed)
to be issued.
Any make keystroke causes INT 0x15 Function 0x91, Subfunction 0x02 (Interrupt
complete from Keyboard) to be issued.
After any scan code is read from I/O port 0x60 and INT 0x15, Function 0x4F (Keyboard
Intercept) is issued. An EOI is issued upon returning from the Keyboard Intercept.
Memory Location 40:1E
This location is the start of a 32-byte keyboard buffer.
Memory Location 40:1A
This location is a Word memory location. It points to the next character in the keyboard
buffer.
Memory Location 40:1C
This location is a Word memory location. It points to the last character in the keyboard
buffer. If the value equals the value in memory location 40:1A, the keyboard buffer is
empty. If the value is two bytes from the contents of memory location 40:1A, the
keyboard buffer is full.
Memory Location 40:17
This location is a Byte memory location and contains the keyboard status byte.
Memory Location 40:18
This location is a Byte memory location and contains the extended keyboard status byte.
Memory Location 40:96
This location is a Word memory location and contains the extended keyboard status.
Memory Location 40:72
This location is a Word memory location and contains the soft reset flag.