Table B.2.1g Signed Multiplication and Division Instructions (Word/Long-Word)
Mnemonic
#
DIV
A
1
DIV
A,ear
2
DIV
A,eam
2+
DIVW
A,ear
2
DIVW
A,eam
2+
MUL
A
2
MUL
A,ear
2
MUL
A,eam
2+
MULW
A
2
MULW
A,ear
2
MULW
A,eam
2+
*1:
3 when dividing into zero, 8 or 18 when an overflow occurs, and 18 normally.
*2:
3 when dividing into zero, 10 or 21 when an overflow occurs, and 22 normally.
*3:
4 + (a) when dividing into zero, 11 + (a) or 22 + (a) when an overflow occurs, and 23 + (a)
normally.
*4:
When dividend is positive: 4 when dividing into zero, 10 or 29 when an overflow occurs, and 30
normally.
When dividend is negative: 4 when dividing into zero, 11 or 30 when an overflow occurs, and 31
normally.
*5:
When dividend is positive: 4+ (a) when dividing into zero, 11+ (a) or 30+ (a) when an overflow
occurs, and 31+ (a) normally.
When dividend is negative: 4+ (a) when dividing into zero, 12+ (a) or 31+ (a) when an overflow
occurs, and 32+ (a) normally.
*6:
(b) when dividing into zero or when an overflow occurs, and 2 × (b) normally.
*7:
(c) when dividing into zero or when an overflow occurs, and 2 × (c) normally.
*8:
3 when byte (AH) is zero, 12 when the result is possible, and 13 when the result is negative.
*9:
3 when byte (ear) is zero, 12 when the result is possible, and 13 when the result is negative.
*10:
4 + (a) when byte (eam) is zero, 13 + (a) when the result is positive, and 14 + (a) when the result
is negative.
*11:
3 when word (AH) is zero, 12 when the result is possible, and 13 when the result is negative.
*12:
3 when word (ear) is zero, 16 when the result is possible, and 19 when the result is negative.
*13:
4 + (a) when word (eam) is zero, 17 + (a) when the result is positive, and 20 + (a) when the
result is negative.
Note: Two cycle counts are given for overflows occurring from DIV or DIVW instructions, because the
overflow may be detected before or after execution.
The contents of AL are destroyed when an overflow occurs from a DIV or DIVW instruction.
For an explanation of "(a)" to "(d)" in the colunm "B", see Table B.2d and Table B.2e.
MB90580 Series
(11 Instructions)
~
RG
B
*1
0
0
word (AH) / byte (AL)
Quotient → byte (AL)
Remainder → byte (AH)
*2
1
0
word (A) / byte (ear)
Quotient → byte (A)
Remainder → byte (ear)
*3
0
*6
word (A) / byte (eam)
Quotient → byte (A)
Remainder → byte (ear)
*4
1
0
long (A) / word (ear)
Quotient → word (A)
Remainder → word (ear)
*5
0
*7
long (A) / word (eam)
Quotient → word (A)
Remainder → word (eam)
byte (AH) * byte (AL) → word (A)
*8
0
0
byte (A) * byte (ear) → word (A)
*9
1
0
byte (A) * byte (eam) → word (A)
*10
0
(b)
word (AH) * word (AL) → Long (A)
*11
0
0
word (A) * word (ear) → Long (A)
*12
1
0
word (A) * word (eam) → Long (A)
*13
0
(c)
Operation
LH
Z
Z
Z
-
-
-
-
-
-
-
-
B.2 Instruction Set
AH
I
S
T
N
Z
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
APPENDIX B: Instructions
V
C
RMW
∗
∗
-
∗
∗
-
∗
∗
-
∗
∗
-
∗
∗
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
325