Skip to content

Commit e1a3e1d

Browse files
[libc] optimize strlen
1 parent 630537d commit e1a3e1d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libc/strlen.src

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ _strlen := $0000D4
1010
else
1111

1212
_strlen:
13-
pop de
13+
pop bc
1414
ex (sp),hl
15-
push de
16-
push hl
17-
pop de
15+
push bc
1816
xor a,a
1917
ld bc,0
2018
cpir
19+
or a,a
20+
sbc hl,hl
2121
scf
22-
sbc hl,de
22+
sbc hl,bc
2323
ret
2424

2525
end if

0 commit comments

Comments
 (0)