GetKey via Interrupt or I/O

Reply

Join Date: Aug 2005
Posts: 148
Reputation: sDJh is an unknown quantity at this point 
Solved Threads: 13
sDJh sDJh is offline Offline
Junior Poster

GetKey via Interrupt or I/O

 
0
  #1
Aug 16th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 148
Reputation: sDJh is an unknown quantity at this point 
Solved Threads: 13
sDJh sDJh is offline Offline
Junior Poster

Re: GetKey via Interrupt or I/O

 
0
  #2
Aug 17th, 2005
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 =)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC