762 762 2FA CHAR Internal code value for the most recent character read or written (internal code for the value in ATACHR below). This register is difficult to use with PEEK statements since it returns the most recent character; most often the cursor value (128, $80 for a visible, zero for an invisible cursor). 763 2FB ATACHR Returns the last ATASCII character read or written or the value of a graphics point. ATACHR is used in converting the ATASCII code to the internal character code passed to or from CIO. It also returns the value of the graphics point. The FILL and DRAW commands use this location for the color of the line drawn, ATACHR being temporarily loaded with the value in FILDAT, location 765; $2FD. To force a color change in the line, POKE the desired color number here (color * sixteen + luminance). To see this register in use as character storage, try: 10 OPEN#2,4,0,"K:" 20 GET#2,A 30 PRINT PEEK(763);" "; CHR$(A) 40 GOTO 20 Make sure the PEEK statement comes before the PRINT CHR$ statement, or you will not get the proper value returned. When the RETURN key is the last key pressed, ATACHR will show a value of 155. 764 2FC CH Internal hardware value for the last key pressed. POKE CH with 255 ($FF; no key pressed) to clear it. The keyboard handler gets all of its key data from CH. It stores the value 255 here to indicate the key code has been accepted, then passes the code to CH1, location 754 ($2F2). If the value in CH is the same as in CH1, a key code will be accepted only if the proper key debounce delay time has transpired. If the code is the CTRL-1 combination (the CTRL and the "1" keys pressed simultaneously), then the start/stop flag at 767 ($2FF) is complemented, but the value is not stored in CH. The auto repeat logic will also store store key information here as a result of the continuous pressing of a key. This is neither the ATASCII nor the internal code value; it is the "raw" keyboard matrix code for the key pressed. The table for translation of this code to ATASCII is on page 50 of the OS User's Manual. In a two-key operation, BIT 7 is set if the CTRL key is pressed, BIT 6 if the SHIFT key is pressed. The rest of the bytes are the code (ignored if both BITs 7 and 6 are set). Only the code for the last key pressed is stored here (it is a global variable for