you have to push and pop another djnz loop right before then end of the first one to get a getkey do this: no_key: call _getkey ;result stored in a cp 0 ; no key pressed jr z,no_key ; no key was pressed so go back to no_key key_pressed: . . .