Prev: 50963 Up: Map Next: 51092
51069: Poll H Key
Used by the routine at 50963.
Reads keyboard port 191 bit 4 (the "H" key) on each pass of the inner loop. Key bits are active-low (0 = pressed); if "H" is not pressed, D is decremented, otherwise E is decremented. Called from 50963 while handling the attribute bar after the key has been detected.
PollHKey 51069 LD D,21 Initialise D to 21 (down-counter for "H" not pressed).
51071 LD E,21 Initialise E to 21 (down-counter for "H" pressed).
51073 LD B,20 Set an inner loop counter to 20 loops.
PollHKey_Loop 51075 LD A,191 Read from the keyboard;
Port Number Bit
0 1 2 3 4
191 ENTER L K J H
51077 IN A,(254)
51079 AND %00010000 Keep only bit 4 ("H" key).
51081 JP NZ,PollHKey_NotPressed If "H" is not pressed (bit 4 is 1), jump to PollHKey_NotPressed to decrement D.
"H" key was pressed.
51084 DEC E Decrease E by one.
51085 JP PollHKey_Continue Jump to PollHKey_Continue (skip the D decrement).
PollHKey_NotPressed 51088 DEC D Decrease D by one.
PollHKey_Continue 51089 DJNZ PollHKey_Loop Decrease the inner loop counter and loop back to PollHKey_Loop until it reaches zero.
51091 RET Return.
Prev: 50963 Up: Map Next: 51092