aboutsummaryrefslogtreecommitdiff
path: root/src/isnum.s
blob: 7aa32512fa41d3095108e7e5f901538a692b6064 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

 .export _isnum

 ; isdigit() replacement that avoids cc65's ctype bloat.
 ; returns 0 in A/X for non-digit, non-zero for digit.
 ; *also* when calling from asm, the Z flag is set for
 ; non-digit, clear for digit.
_isnum:
 cmp #'0'
 bcc ret0
 cmp #'9'+1
 bcs ret0
 lda #1
 .byte $2c
ret0:
 lda #0
 tax
 rts