6 ; If open_apple key is pressed then the high-bit of the key is set.
10 .import cursor, putchardirect
21 lda #$7F | $80 ; Checkerboard, screen code
23 lda #' ' | $40 ; Blank, flashing
25 jsr putchardirect ; Returns old character in X
27 ; Wait for keyboard strobe.
28 : inc RNDL ; Increment random counter low
30 inc RNDH ; Increment random counter high
32 bpl :-- ; If < 128, no key pressed
38 ; Restore old character.
44 ; At this time, the high bit of the key pressed is set.
45 : bit KBDSTRB ; Clear keyboard strobe
47 bit BUTN0 ; Check if OpenApple is down
50 and #$7F ; If not down, then clear high bit