This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Type: Variable Category: Keyboard Summary: Translation table from internal key number to ASCII
Valid internal key numbers are Binary Coded Decimal (BCD) numbers in the range &10 top &79, so they're in the ranges &10 to &19, then &20 to &29, then &30 to &39, and so on. This means that the other locations - i.e. &1A to &1F, &2A to &2F and so on - aren't used by the lookup table, but the MOS doesn't let this space go to waste; instead, those gaps contain MOS code, which is replicated below as the table contains a copy of this entire block of the MOS, not just the table entries. This table allows code running on the parasite to convert internal key numbers into ASCII codes in an efficient way. Without this table we would have to do a lookup from the table in the I/O processor's MOS ROM, which we would have to access from across the Tube, and this would be a lot slower than doing a simple table lookup in the parasite's user RAM.