SCNKEY

Scan the keyboard
Function AddressDescription
SCNKEY FF9FScan the keyboard

This routine scans the Commodore 64 keyboard and checks for pressed keys. It is the same routine called by the interrupt handler. If a key is down, its ASCII value is placed in the keyboard queue. This routine is called only if the normal IRQ interrupt is bypassed.

Example:
getKeyJSRSCNKEYScan keyboard
JSRGETINGet character
CMP#0Have we got a character?
BEQgetKeyNo then loop back
JMPCHROUTPrint it to the screen