From C64-Wiki
Jump to navigationJump to search

The zeropage address 203 ($CB) holds the keyboard code from the most recent time the keyboard was scanned with the operating system's SCNKEY routine. By default, the keyboard scanning is maintained by the interrupt service routine in KERNAL ROM, and so address 203 can be said to hold the keyboard code for whichever key is currently being pressed.

Before scanning the keyboard to obtain a "new" current key code, the interrupt service routine transfers the old value from address 203 into address 197. Only when 197 contains the code 64 to indicate "no key pressed", and 203 contains the code for a "new" key (some value less than 64), does non-repeating (see address 650) keys actually cause a character to be entered.