wait_until_keypressed:
lda KEYPRESS ; check if keypressed
bpl wait_until_keypressed ; if not, loop
bit KEYRESET
rts