1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-05 08:05:51 +00:00
cc65/libsrc/common/ispunct.s

26 lines
677 B
ArmAsm
Raw Normal View History

;
; 1998-06-02, Ullrich von Bassewitz
; 2013-05-01, Greg King
;
; int ispunct (int c);
;
.export _ispunct
.include "ctype.inc"
_ispunct:
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)
@L1: lda #<0 ; Return false
tax
rts