1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-30 20:18:06 +11:00
collapseos/kernel/zxspectrum/kbd.asm

16 lines
306 B
NASM
Raw Permalink Normal View History

; the ZX Spectrum BASIC firmware scans the keyboard for ASCII codes on clock interrupts
; this routine just waits for a key and reads its value
k_getc:
;ei
push hl
ld hl, 23611 ; ZXS_FLAGS
res 5, (hl)
.loop:
bit 5, (hl) ; pressed?
jr z, .loop
ld hl, 23560 ; ZXS_LASTK
ld a, (hl)
pop hl
ret