PEEK(197) or PEEK(203) Keyboard Scan Codes

I have recently been typing some basic games from the Melbourne House Games Book 2, and in these games they heavily use the Peek(197) or Peek(203) comment for scanning the keyboard, but they do not show which characaters the results of these peeks are.

So I did my investigation of my own, and here are the results.

The keyscan interrupt routine uses this location to indicate which key is currently being pressed. The value here is then used as an index into the appropriate keyboard table to determine which character to print when a key is struck.

The correspondence between the key pressed and the number stored here is as follows:

The RESTORE key is not accounted for, because it is not part of the normal keyboard matrix. Instead, it is connected directly to the microprocessor NMI line, and causes an NMI interrupt whenever it is pressed.

For those who are using the Peek Codes, here is a list of Constants for CBM PRG Studio:

***UPDATE***, and now the constants for Kick Assembler 🙂