ctype size optimization
This commit is contained in:
committed by
Oliver Schmidt
parent
dc5114b071
commit
ce80624f62
@@ -1,21 +1,21 @@
|
||||
; isspace.s
|
||||
;
|
||||
; Ullrich von Bassewitz, 02.06.1998
|
||||
; This file is part of
|
||||
; cc65 - a freeware C compiler for 6502 based systems
|
||||
;
|
||||
; https://github.com/cc65/cc65
|
||||
;
|
||||
; See "LICENSE" file for legal information.
|
||||
;
|
||||
; int isspace (int c);
|
||||
;
|
||||
|
||||
.export _isspace
|
||||
.include "ctype.inc"
|
||||
.import ctype_preprocessor
|
||||
|
||||
_isspace:
|
||||
cpx #$00 ; Char range ok?
|
||||
bne @L1 ; Jump if no
|
||||
tay
|
||||
lda __ctype,y ; Get character classification
|
||||
and #(CT_SPACE | CT_OTHER_WS) ; Mask space bits
|
||||
rts
|
||||
|
||||
@L1: lda #$00 ; Return false
|
||||
tax
|
||||
rts
|
||||
|
||||
jsr ctype_preprocessor ; (clears always x)
|
||||
bcs @L1 ; out of range? (everything already clear -> false)
|
||||
and #(CT_SPACE | CT_OTHER_WS) ; mask space bits
|
||||
@L1: rts
|
||||
|
||||
Reference in New Issue
Block a user