
B.6Numerical Calculation Instructions
215
Table B.6e Signed Multiply/Divide Instructions (Word, Long-Word): 11 Instructions
*1:
3 in case of zero division, 8 or 18 in case of overflow, normally 18.
*2:
3 in case of zero division, 10 or 21 in case of overflow, normally 22.
*3:
4 + (a) in case of zero division, 11 + (a) or 22 + (a) in case of overflow, normally 23 + (a).
*4:
For positive dividends: 4 in case of zero division, 10 or 29 in case of overflow, normally 30.
For negative dividends: 4 in case of zero division, 11 or 30 in case of overflow, normally 31.
*5:
For positive dividends: 4 + (a) in case of zero division, 11 + (a) or 30 + (a) in case of overflow, nor-
mally 31 + (a).
For negative dividends: 4 + (a) in case of zero division, 12 + (a) or 31 + (a) in case of overflow, nor-
mally 32 + (a).
*6:
(b) in case of zero division or overflow, normally 2 × (b).
*7:
(c) in case of zero division or overflow, normally 2 × (c).
*8:
3 when byte (AH) is zero, 12 when result is positive, 13 when result is negative.
*9:
3 when byte (ear) is zero, 12 when result is positive, 13 when result is negative.
*10: 4 + (a) when byte (eam) is zero, 13 + (a) when result is positive, 14 + (a) when result is negative.
*11: 3 when word (AH) is zero, 12 when result is positive, 13 when result is negative.
*12: 3 when word (ear) is zero, 16 when result is positive, 19 when result is negative.
*13: 4 + (a) when word (eam) is zero, 17 + (a) when result is positive, 20 + (a) when result is negative.
The notation (a) in the - 'cycle count' column indicates a reference to Appendix B.4a.
The notation '+' in the # 'byte count' column indicates a reference to Appendix B.3.
The notations (b), (c) and (d) in the B (compensation value) column indicate a reference to Appendix B.4b.
Note:
Two different actual cycle counts are given for DIV instruction and DIVW instructions ending in
overflow, representing detection before or after calculation.
When DIV instructions or DIVW instructions result in overflow, the contents of the AL are
destroyed.
Mnemonic
#
~
B
Operation
LH
AH
I
S
T
N
Z
V
C
RMW
DIV
A
DIV
A,ear
DIV
A,eam
DIVW
A,ear
DIVW
A,eam
2
2+
2
2+
*1
*2
*3
*4
*5
0
*6
0
*7
word (AH) / byte (AL)
Quotient
→ byte (AL) Remainder →
byte (AH)
word (A) / byte (ear)
Quotient
→ byte (A) Remainder →
byte (ear)
word (A) / byte (eam)
Quotient
→ byte (A) Remainder →
byte (ear)
long (A) / word (ear)
Quotient
→ word (A) Remainder →
word (ear)
long (A) / word (eam)
Quotient
→ word (A) Remainder →
word (eam)
Z
-
*
-
MUL
A
MUL
A,ear
MUL
A,eam
MULW
A
MULW
A,ear
MULW
A,eam
2
2+
2
2+
*8
*9
*10
*11
*12
*13
0
(b)
0
(b)
byte (AH) * byte (AL)
→ word (A)
byte (A) * byte (ear)
→ word (A)
byte (A) * byte (eam)
→ word (A)
word (AH) * word (AL)
→ Long (A)
word (A) * word (ear)
→ Long (A)
word (A) * word (eam)
→ Long (A)
-