Skip to content

Commit 1f06a87

Browse files
[libc] optimize _isprint
1 parent 9828409 commit 1f06a87

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/libc/isprint.src

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@
33
section .text
44
public _isprint
55
_isprint:
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,32
11+
add a,-95
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,47
19-
sbc hl,hl
20-
ld l,a
13+
inc hl
2114
ret
22-
23-
extern ___maptab

0 commit comments

Comments
 (0)