Skip to content

Commit 4071f91

Browse files
[libc] optimize _isupper
1 parent 97722a6 commit 4071f91

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/libc/isupper.src

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@
33
section .text
44
public _isupper
55
_isupper:
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-
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,8
19-
sbc hl,hl
20-
ld l,a
12+
cp a,65
13+
ret c
14+
cp a,90+1
15+
ret nc
16+
inc l
2117
ret
2218

23-
extern ___maptab

0 commit comments

Comments
 (0)