1 ; vi:filetype=nasm ts=8 sts=8 sw=8:
8 push dword IRQ_TO_INTR(KB_IRQ)
12 ; enable keyboard interrupt
13 mov eax, KB_CMD_GET_CMDBYTE
16 or eax, KB_CCB_KB_INTREN ; set the INTREN flag
18 mov eax, KB_CMD_SET_CMDBYTE
23 ; flush the read buffer
30 ; keyboard interrupt handler
39 ; keystate[keycode] address in ebx
44 ; determine if it's a press or release
69 .loop: in al, KB_STATUS_PORT
70 test al, KB_STAT_INBUF_FULL
83 .loop: in al, KB_STATUS_PORT
84 test al, KB_STAT_OUTBUF_FULL
93 ; expects command in al
107 keystate: times 256 db 0