Page 1 of 1

Keyboard driver REAL MODE

Posted: Sun Sep 16, 2007 8:51 am
by matias_beretta
int37:
in al, 96 ;60h
cmp al, 0 ;NOKEY
je int37
iret

This doesn't work and I can't understand why...

Posted: Sun Sep 16, 2007 9:10 am
by frank
Are you converting the values you receive from keyboard scancodes to character codes? Also it doesn't look like you are storing the value you receive anywhere.

Reply

Posted: Sun Sep 16, 2007 9:18 am
by matias_beretta
I only want to get the scancode for now... in AL...

Posted: Sun Sep 16, 2007 9:41 am
by frank
Okay well in real mode the BIOS handles the keyboard, so as soon as the key gets pressed IRQ1 is fired and the BIOS reads the scancode. You could maybe map IRQ1 to an empty function.

Posted: Sun Sep 16, 2007 9:01 pm
by exkor
what are the values after 'in' instruction from different keys? print them on the screen and tell us. How does int37 gets called? after which event? no magicians here.
You could use:
xor ax, ax
int 16h
to wait for key to be pressed