2000-05-28 13:40:48 +00:00
|
|
|
;
|
2013-05-01 19:04:36 +00:00
|
|
|
; 1998-06-02, Ullrich von Bassewitz
|
2014-09-10 23:15:07 +00:00
|
|
|
; 2014-09-10, Greg King
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; int isgraph (int c);
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _isgraph
|
|
|
|
.include "ctype.inc"
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
_isgraph:
|
2014-09-10 23:15:07 +00:00
|
|
|
cpx #>$0000 ; Char range OK?
|
2013-05-09 11:56:54 +00:00
|
|
|
bne @L1 ; Jump if no
|
|
|
|
tay
|
|
|
|
lda __ctype,y ; Get character classification
|
|
|
|
and #CT_CTRL_SPACE ; Mask character bits
|
|
|
|
cmp #1 ; If false, then set "borrow" flag
|
|
|
|
lda #0
|
|
|
|
sbc #0 ; Invert logic
|
|
|
|
rts ; Return NOT control and NOT space
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
@L1: lda #<0 ; Return false
|
|
|
|
tax
|
|
|
|
rts
|
2000-06-08 18:35:04 +00:00
|
|
|
|