Skip to content

Commit 4dbccb2

Browse files
committed
fixed clock cycle count for lmulu_b and added timings for llmulu_b
1 parent d663153 commit 4dbccb2

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/crt/llmulu_b.src

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
assume adl=1
22

33
section .text
4+
45
public __llmulu_b
6+
57
__llmulu_b:
8+
; Multiplies BC:UDE:UHL by (SP) and returns the 64-bit unsigned product bc:ude:uhl.
9+
; I: (SP) = 8-bit multiplier, BC:UDE:UHL = multiplicand, ADL=1
10+
; O: bc:ude:uhl = BC:UDE:UHL * (SP)
11+
; CC: 135*r(PC)+21*r(SPL)+18*w(SPL)+33
12+
; CC: 134 bytes | 135F + 21R + 18W + 33
613
push af
714
push iy
815
ld iy, 0

src/crt/lmulu_b.src

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ __lmulu_b:
99
; Multiplies EUHL by A and returns the 32-bit product euhl.
1010
; I: A=multiplier, EUHL=multiplicand, ADL=1
1111
; O: euhl=EUHL*A
12-
; CC: 43*r(PC)+12*r(SPL)+9*w(SPL)+13
13-
; CC: 42 bytes | 43F + 12R + 9W + 13
12+
; CC: 43*r(PC)+12*r(SPL)+9*w(SPL)+17
13+
; CC: 42 bytes | 43F + 12R + 9W + 17
1414
Mul_EUHL_A_EUHL:
1515
push bc
1616
push de
@@ -45,7 +45,7 @@ Mul_EUHL_A_EUHL:
4545
add hl, hl
4646
add hl, hl
4747
add hl, hl
48-
48+
4949
mlt de ; DE = A * L
5050
add hl, de ; UHL = AH.hi + AU.lo, AH.lo + AL.hi, AL.lo
5151

src/crt/lmulu_b_fast.src

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ __lmulu_b_fast:
99
; Multiplies EUHL by A and returns the 32-bit product euhl.
1010
; I: A=multiplier, EUHL=multiplicand, ADL=1
1111
; O: euhl=EUHL*A
12-
; CC: 37*r(PC)+6*r(SPL)+3*w(SPL)+13
13-
; CC: 36 bytes | 37F + 6R + 3W + 13
12+
; CC: 37*r(PC)+6*r(SPL)+3*w(SPL)+17
13+
; CC: 36 bytes | 37F + 6R + 3W + 17
1414
Mul_EUHL_A_EUHL:
1515
dec sp
1616
push hl
@@ -42,7 +42,7 @@ Mul_EUHL_A_EUHL:
4242
add hl, hl
4343
add hl, hl
4444
add hl, hl
45-
45+
4646
mlt de ; DE = A * L
4747
add hl, de ; UHL = AH.hi + AU.lo, AH.lo + AL.hi, AL.lo
4848

0 commit comments

Comments
 (0)