Skip to content

Instantly share code, notes, and snippets.

@gammy
Created January 6, 2012 16:02
Show Gist options
  • Save gammy/1571188 to your computer and use it in GitHub Desktop.
Save gammy/1571188 to your computer and use it in GitHub Desktop.
16 bit 486 escape key detect
kb_chk_esc:
xor ax, ax
mov ah, 1 ; get keystroke status
int 0x16
jz kb_chk_end ; no key
mov ah, 0 ; get key
int 0x16
cmp al, 27 ; is it esc?
jne kb_chk_end ; nope
call exit ; yup
kb_chk_end:
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment