Skip to content

Commit c8305af

Browse files
committed
Optimized lmulhu
1 parent 25e9b61 commit c8305af

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/crt/lmulhu.src

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@ __lmulhu:
1414
ld iyl, a
1515
push iy
1616
push bc
17-
ld iyl, iyh ; ld iy, 0
18-
lea bc, iy + 0
19-
inc de
20-
dec.s de
21-
ld d, b
17+
ld c, e
18+
lea de, iy + 0 ; UDE = 0, D = 0
19+
ld e, c
20+
ld c, d
21+
ld b, d
2222
call __llmulu
2323
; E = B
2424
; UHL = C
2525
; H = UDE
2626
; L = D
27-
add iy, sp
27+
scf
28+
sbc hl, hl
29+
add hl, sp
2830
push de
29-
ld e, (iy - 1) ; H = UDE
30-
ld (iy - 1), c ; UHL = C
31+
ld e, (hl) ; H = UDE
32+
ld (hl), c ; UHL = C
3133
pop hl ; UHL = C
3234
ld h, e ; H = UDE
3335
ld l, d ; L = D

0 commit comments

Comments
 (0)