Fixed isgraph() and ispunct() (macroes and library functions).
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 02.06.1998
|
||||
; 1998-06-02, Ullrich von Bassewitz
|
||||
; 2013-05-01, Greg King
|
||||
;
|
||||
; int ispunct (int c);
|
||||
;
|
||||
|
||||
.export _ispunct
|
||||
.include "ctype.inc"
|
||||
.include "ctype.inc"
|
||||
|
||||
_ispunct:
|
||||
cpx #$00 ; Char range ok?
|
||||
cpx #>0 ; Char range OK?
|
||||
bne @L1 ; Jump if no
|
||||
tay
|
||||
lda __ctype,y ; Get character classification
|
||||
eor #CT_NOT_PUNCT ; NOT (space | control | digit | alpha)
|
||||
and #CT_NOT_PUNCT ; Mask relevant bits
|
||||
rts
|
||||
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 #$00 ; Return false
|
||||
@L1: lda #<0 ; Return false
|
||||
tax
|
||||
rts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user