]> git.sur5r.net Git - cc65/blob - libsrc/apple2/kbhit.s
Simplify code generated for the ?: operator when type conversion code for the
[cc65] / libsrc / apple2 / kbhit.s
1 ;
2 ; Kevin Ruland
3 ; Ullrich von Bassewitz, 2005-03-25
4 ;
5 ; unsigned char kbhit (void);
6 ;
7
8         .export _kbhit
9
10         .include "apple2.inc"
11
12 _kbhit:
13         lda     KBD             ; Reading KBD checks for keypress
14         rol                     ; if high bit is set, key was pressed
15         lda     #$00
16         tax
17         rol
18         rts