.TT217 STY YSAV \ Store Y in temporary storage, so we can restore it \ later .t DEC KEYB \ Decrement KEYB, so it is now &FF, to indicate that we \ should process all interrupts, including keyboard \ interrupts, so that we can read the keyboard JSR OSRDCH \ Call OSRDCH to read a character from the keyboard INC KEYB \ Increment KEYB back to 0 to indicate that we are done \ reading the keyboard, so we can ignore interrupts TAX \ Copy A into X .out RTS \ Return from the subroutineName: TT217 [Show more] Type: Subroutine Category: Keyboard Summary: Scan the keyboard until a key is pressedContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * gnum calls TT217 * qv calls TT217 * TT214 calls TT217 * mes9 calls via out * OUCH calls via out
Scan the keyboard until a key is pressed, and return the key's ASCII code. If, on entry, a key is already being held down, then wait until that key is released first (so this routine detects the first key down event following the subroutine call).
Returns: X The ASCII code of the key that was pressed A Contains the same as X Y Y is preserved
Other entry points: out Contains an RTS
[X]
Variable KEYB in workspace S% (Part 1 of 2)
This flag indicates whether we are currently processing an OS command (OSWORD, OSRDCH or OSFILE), in which case interrupts will be enabled in the IRQ1 interrupt handler, and keyboard interrupts will be passed to the operating system's keyboard handler in the KEY1 interrupt handler
[X]
Configuration variable OSRDCH = &FFE0
The address for the OSRDCH routine