Skip to content

Commit 45e6ba0

Browse files
[libc] optimize _islower
1 parent 4071f91 commit 45e6ba0

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

src/libc/islower.src

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,15 @@
33
section .text
44
public _islower
55
_islower:
6-
pop hl
76
pop de
7+
ex (sp),hl
88
push de
9-
push hl
9+
ld a,l
1010
or a,a
1111
sbc hl,hl
12-
ld a,e
13-
and a,128
14-
ret nz
15-
ex de,hl
16-
ld de,___maptab
17-
add hl,de
18-
ld a,(hl)
19-
and a,4
20-
sbc hl,hl
21-
ld l,a
12+
cp a,97
13+
ret c
14+
cp a,122+1
15+
ret nc
16+
inc l
2217
ret
23-
24-
extern ___maptab

0 commit comments

Comments
 (0)