implement GETIN function

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-23 00:07:16 +09:30
1 parent 635cefe312
commit 03550ab786
1 file changed
+19
+19
View File
@@ -1,3 +1,22 @@
; Function defined on pp272-273 of C64 Programmers Reference Guide
getin:
;; Wait for a key
lda keys_in_key_buffer
bne +
;; Nothing in keyboard buffer to read
lda #$00
sec
rts
*
lda keyboard_buffer
pha
jsr pop_keyboard_buffer
pla
clc
rts