Skip to content

Commit a0ca9d1

Browse files
[libc] optimize _isdigit
1 parent 7dcf8ff commit a0ca9d1

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/libc/isdigit.src

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@
33
section .text
44
public _isdigit
55
_isdigit:
6-
pop hl
76
pop de
7+
ex (sp),hl
88
push de
9-
push hl
10-
or a,a
9+
ld a,l
10+
sub a,48
11+
add a,-10
1112
sbc hl,hl
12-
bit 7,e
13-
ret nz
14-
ex de,hl
15-
ld de,___maptab
16-
add hl,de
17-
ld a,(hl)
18-
and a,1
19-
sbc hl,hl
20-
ld l,a
13+
inc hl
2114
ret
22-
23-
extern ___maptab

0 commit comments

Comments
 (0)