// also as note for interrupt
When a key is either pressed or released, an interrupt is generated. On an ISA machine this interrupt is allotted, IRQ#1, which in turn is reported by the interrupt controller as interrupt number 9:
IRQ | Allocation | Interrupt Number |
IRQ0 | System Timer | 08H |
IRQ1 | Keyboard | 09H |
The DOS interrupt service routine 9 interrogates the keyboard at I/O port 64H and deposits characters it receives from there in a tiny buffer located at 41EH. The characters come in from the keyboard as scan codes. The ISR converts each scan code to an ASCII character and stores both a scan code and an ASCII code in the buffer.
Reference:
Bob Neveln. Linux Assembly Programming Language. 2000