Prev: 021F Up: Map Next: 02EB
02AD: Test Keys Variable
Used by the routine at HandleInterrupt.
Look up the BASIC variable "keys". A value of 01 enables speaking each key press.
Output
F Z flag set if key speech is enabled
TestKeysVariable 02AD LD A,$AB Call FindVariable for "keys".
02AF CALL FindVariable
02B2 JR NZ,TestKeysVariable_State Jump to TestKeysVariable_State if it was not found.
02B4 INC HL Move to the first letter of the name.
02B5 LD A,$65 Jump to TestKeysVariable_State if this is not "e".
02B7 CPI
02B9 JR NZ,TestKeysVariable_State
02BB LD A,$79 Jump to TestKeysVariable_State if the next letter is not "y".
02BD CPI
02BF JR NZ,TestKeysVariable_State
02C1 LD A,$F3 Jump to TestKeysVariable_State if the next letter is not "s".
02C3 CPI
02C5 JR NZ,TestKeysVariable_State
02C7 XOR A Jump to TestKeysVariable_State if the name has not ended.
02C8 CPI
02CA JR NZ,TestKeysVariable_State
02CC CPI Jump to TestKeysVariable_State if the value header is not empty.
02CE JR NZ,TestKeysVariable_State
02D0 CP (HL) Jump to TestKeysVariable_Off if keys is 00.
02D1 JR Z,TestKeysVariable_Off
02D3 INC A Jump to TestKeysVariable_State if keys is not 01.
02D4 CP (HL)
02D5 JR NZ,TestKeysVariable_State
02D7 DEC A Call ReadWorkspace for the flags byte.
02D8 CALL ReadWorkspace
02DB SET 1,(HL) Enable key speech.
TestKeysVariable_State 02DD XOR A Call ReadWorkspace for the flags byte.
02DE CALL ReadWorkspace
02E1 BIT 1,(HL) Set the Z flag from the key-speech flag.
02E3 RET Return.
keys is 00; turn key speech off.
TestKeysVariable_Off 02E4 CALL ReadWorkspace Call ReadWorkspace.
02E7 RES 1,(HL) Disable key speech and jump to TestKeysVariable_State.
02E9 JR TestKeysVariable_State
Prev: 021F Up: Map Next: 02EB