]> git.sur5r.net Git - cc65/blob - libsrc/common/isprint.s
Implemented line wrap.
[cc65] / libsrc / common / isprint.s
1 ;
2 ; Ullrich von Bassewitz, 02.06.1998
3 ;
4 ; int isprint (int c);
5 ;
6
7         .export         _isprint
8         .include        "ctype.inc"
9
10 _isprint:
11         cpx     #$00            ; Char range ok?
12         bne     @L1             ; Jump if no
13         tay
14         lda     __ctype,y       ; Get character classification
15         eor     #CT_CTRL        ; NOT a control char
16         and     #CT_CTRL        ; Mask control char bit
17         rts
18
19 @L1:    lda     #$00            ; Return false
20         tax
21         rts
22