DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Assembly (http://www.daniweb.com/forums/forum125.html)
-   -   GetKey via Interrupt or I/O (http://www.daniweb.com/forums/thread30638.html)

sDJh Aug 16th, 2005 12:06 pm
GetKey via Interrupt or I/O
 
Hello everybody,
I just signed up, 'cause I looked through the internet over days to find a solution for the BASIC function GetKey(). It simply returns the Scancode of a key pressed by the user or 0 by default (if no key was pressed).

I found the well known BIOS Interrupt Int 16h but both functions AX=1 and AX=0 stop the execution of my programm and wait 'til a key is pressed.

So I regarded some codes with I/O exchanges, and I sat down for a few hours to read the scancode from port 60 and translate it into an ASCII-character. Well, this works fine by now, except that
1) everytime I press a key I hear a *beap* from the motherboard (I guess)
2) after a while typing in a text the programm becomes really, really slow - I guess that there's an overflow in writing to/reading from the ports (the same sort of lack of speed as I experienced when I first wrote a network-game in UDP)

How may solve that problem?
Thanks a lot for your replies!
Simon

sDJh Aug 17th, 2005 11:20 am
Re: GetKey via Interrupt or I/O
 
I found the solution for myself. I put the function ID in AL and not AH as BIOS expect me to do. Working now the way as I want to =)


All times are GMT -4. The time now is 8:32 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC