![]() |
Routines |
| Prev: 50963 | Up: Map | Next: 51092 |
| 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;
|
|||||||||||||||||
| 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 |