Skip to content

Commit 1c404ee

Browse files
committed
what happens when you assume
1 parent 4666037 commit 1c404ee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libc/ilogbf.src

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ _ilogbf:
3636
sbc hl, de
3737
jr z, .ret_zero
3838
call __ictlz
39-
; Carry flag will be set at the end of __ictlz
40-
; scf
41-
sbc hl, hl
42-
neg
43-
add a, 129
39+
ex de, hl
40+
; DE was zero, so HL is now zero
41+
dec hl
42+
cpl
43+
add a, 130
4444
ld l, a
4545
ret
4646

0 commit comments

Comments
 (0)