keyboard port 0x64

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
slacker

keyboard port 0x64

Post by slacker »

this function is supposed to check port 0x64 and loop until bit 0 is zero but its not workin...when bit 0 is equal to one it means a key was pressed or released..i think??
anyone know my problem? thank you

/*wait for keyboard buffer will wait for bit 0 of port 0x64 to equal 1.
then we know a key has been pressed or released*/

void wait_kbdbuff()
{
unsigned temp=0x00;
while(temp == 0x00) //while bit 0 is 0
{
temp=portin(0x64);
temp=(temp & 0x01);
};
};
Chris Giese

Re:keyboard port 0x64

Post by Chris Giese »

It looks OK to me.

Maybe put this code and the code for portin() into one file, compile the file (do not link), then disassemble the object file to see if it's correct: objdump --disassemble --reloc file.o
Post Reply