I've been trying to write a "getch()" function using ports but i gets this problem:
when i call this function for the first time it works normally,
i press somekey and the function prints the asciikey,but when i call it
agin it prints the previous asciikey without any input from me!!!
you get it?
first time works normally.
Second time prints the previous char and this is the code:
unsigend char c='\0';
so would you please help me
and tell me what's wrong with this code