Hello. I have a homework. My development environment: Turbo C++ 3.0
and programming Language Assembly, ANSI C. I have to detect when the user press Space or right or left arrow keys. It is forbidden that using "dos.h" and "int 21H"
I have found this information but I could not understand how to implement it :
When a key is pressed on keyboard, an interrupt along with a scan code named “make code” is produced and when the key released a “break code” is produced by the keyboard controller. On a PC, keyboard is controlled by a chip and assigned to port numbers 60h and 61h. When a key is pressed on keyboard, scan value is put in register at 60h. You can get this scan code with the following command: in al,60h After getting the scan code, you have to reset the keyboard programming the command register of the chip at 61h with following commands: in al,61h or al,82h out 61h,al and al,7fh out 61h,al At the end of every interrupt service routine, you clear PIC service bit, sending End Of Interrupt (EOI) command, 20h to PIC port at address 20h. mov al,20h out 20h,al