2000-05-28 13:40:48 +00:00
|
|
|
;
|
2013-05-01 19:04:36 +00:00
|
|
|
; 1998-06-02, Ullrich von Bassewitz
|
|
|
|
; 2013-05-01, Greg King
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; int ispunct (int c);
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _ispunct
|
|
|
|
.include "ctype.inc"
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
_ispunct:
|
2013-05-09 11:56:54 +00:00
|
|
|
cpx #>0 ; Char range OK?
|
|
|
|
bne @L1 ; Jump if no
|
|
|
|
tay
|
|
|
|
lda __ctype,y ; Get character classification
|
|
|
|
and #CT_NOT_PUNCT ; Mask relevant bits
|
|
|
|
cmp #1 ; If false, then set "borrow" flag
|
|
|
|
lda #0
|
|
|
|
sbc #0 ; Invert logic
|
|
|
|
rts ; Return NOT (space | control | digit | alpha)
|
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
|
|
|
|