| Routines

15D4: THE 'WAIT-KEY' SUBROUTINE

Used by the routines at SA_CONTRL, PO_SCR, EDITOR and ED_IGNORE. This subroutine is the controlling subroutine for calling the current input subroutine.
WAIT_KEY | 15D4 | BIT 5,(IY+$02) | Jump forward if the flag (bit 5 of TV-FLAG) indicates the lower screen does not require clearing.
| 15D8 | JR NZ,WAIT_KEY1
| 15DA | SET 3,(IY+$02) | Otherwise signal 'consider the mode as having changed' (set bit 3 of TV-FLAG).
WAIT_KEY1 | 15DE | CALL INPUT_AD | Call the input subroutine indirectly via INPUT_AD.
| 15E1 | RET C | Return with acceptable codes.
| 15E2 | JR Z,WAIT_KEY1 | Both the carry flag and the zero flag are reset if 'no key is being pressed'; otherwise signal an error.
Report 8 - End of file.
| 15E4 | RST $08 | Call the error handling routine.
| 15E5 | DEFB $07