ORG $300 KBD EQU $C000 ; location of keyboard data KBDSTRB EQU $C010 ; location of keyboard strobe latch ReadKey BIT KBD ; test high bit of data reg. BPL ReadKey ; If not set retest till it is set LDA KBD ; Data at KBD is Valid (High Bit set) BIT KBDSTRB ; now clear the keyboard for the next char RTS ; and we are done. |
BIT KBDSTRB ; Clear out any data that is already at KBD WaitForA JSR ReadKey ; get a key from the keyboard CMP #$C1 ; is it an A???? BNE WaitForA ; Nope go get another RTS |