key

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ammar
Posts: 14
Joined: Thu Feb 11, 2016 10:55 am
Libera.chat IRC: ammars6

key

Post by ammar »

cli
mov al,2 ; disable IRQ 1
out 21h,al
sti

;------------- Main loop
P1:

in al, 64h ; get status
test al, 1
jz short NOKEY
test al, 20h ; byte from PS2 mouse?
jnz short NOKEY
in al, 60h
dec al ; exit if escape key pressed
jz HOME
; placeholder for checking more keys using a table of keys
NOKEY:

jmp P1
;------------------------
HOME:
cli
xor al, al ; enable IRQ 1
out 21h, al
sti
mov ah, 1 ; clear keyboard buffer
int 16h
; placeholder for terminate program
this code testing keybood connecting with memory ???
eidt code ?
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: key

Post by BrightLight »

You know your OS is advanced when you stop using the Intel programming guide as a reference.
Post Reply