diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-04-05 19:59:30 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-04-05 19:59:30 -0400 |
| commit | 900eb9bca18f57531bc74d3a5f5b5e87870cd1ae (patch) | |
| tree | 5ee6d1047444e9e2473945e2df6025897a89d16a /src/isnum.s | |
| parent | 06bdd272adb09ae5b55a068dfa879ce005cf4748 (diff) | |
| download | fujinet-chat-900eb9bca18f57531bc74d3a5f5b5e87870cd1ae.tar.gz | |
Replace cc65 lib isdigit() and atoi() with less bloated isnum() and a2uint().
Diffstat (limited to 'src/isnum.s')
| -rw-r--r-- | src/isnum.s | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/isnum.s b/src/isnum.s new file mode 100644 index 0000000..7aa3251 --- /dev/null +++ b/src/isnum.s @@ -0,0 +1,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 |
