BENCHMARK:
l6-Bit Multiply
PROCESSOR:
Motorola
6809
Bytes
Cycles
3 3
LDX
4 5
LDY
3 3
LDU
~
6
CLR
~
6
CLR
~
5
LDA
~
5
LDB
1
11
MUL
~
6
STD
~
4
LDA
~
5
LDB
1
11
MUL
~
7
ADDD
~
6
STD
~
3
BCC
~
6
INC
~
5
ABl
LDA
~
4
LDB
1
11
MUL
~
7
ADDD
2
6
STD
~
3
BCC
~
6
INC
~
4
AB~
LDA
~
4
LDB
1
11
MUL
2 7
ADDD
~
6
STD
APPENDIX
;REGISTER
USAGE:
#M
#BB
#MO
O,U
1,U
1,X
1,
Y
2,U
O,X
1,Y
1,U
1,U
ABl
O,U
1,X
O,Y
1,U
1,U
AB2
O,U
O,X
O,Y
O,U
O,U
D -
ACCUMULATOR
X -
OPERAND
POINTER
Y -
OPERAND
POINTER
U -
PRODUCT
POINTER
;Pointer to multiplicand
A(MS
Byte)
;Pointer to multiplicand
B(MS
Byte)
;Pointer to product
;CLR
MO
;CLR
Ml
;Read
LS
byte of A
(AL)
;Read
LS
byte of B
(BL)
;AL*BL
;Store
in
M3:M2
;Read
MS
byte
of
A
(AH)
;Read
LS
byte of B
(BL)
;AH*BL
;AH*BL
+
MS
byte
from
AL*BL
;Store
in
M2:Ml
;Skip
INC
if
no
carry
;Add
carry to
MO
;Read
LS
byte of A
(AL)
;Read
LS
byte of B
(BH)
;AL*BH
;AL*BH+
M2:Ml
;Store
in
M~:Ml
;Skip
INC
if
no
carry
;Add
carry to
MO
;Read
AH
;Read
BH
;AH*BH
;AH*BH
+Ml
+ carries
;Store
in
Ml
:MO
56
bytes of
code
28
lines of
code
30
AFN 01532A