Chapter 6 Instruction Details
XBC E-Type Main Unit 6-179 Ve r. 1
6.29.4 DIVB, DIVBP, DDIVB, DDIVBP
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
DIVB(P)
DDIVB(P)
4~6 O O -
BCD data to be divided by S2
BCD data to be divided by S1
Address to save operation result in
[Flag Set]
Flag Description
If the value of S1 and S2 is not of BCD format, if the value of S2 is 0
To be set if operation result is Zero
1) DIVB (BCD Divide)
(1) Saves the result of BCD data S1 divided by S2, the quotient in D, the remainder in D+1.
(2) Based on operation result, Error(F110) or Zero(F111) Flag will be set.
5
6 7 8
S
1
0
8 7 6
S
2
0
4 2 2
0
0 0 6
D+1
D
Remainder
.
.
Quotient
Other places than specified will be regarded as 0
2) DDIVB (BCD Double Divide) Quotient in D, the Remainder
(1) Saves the result of BCD data (S1, S1+1) divided by (S2, S2+1), the quotient in (D, D+1), the remainder in
(D+2, D+3).
(2) Based on operation result, Error(F110) or Zero(F111) Flag will be set.
5
6 7 8
S
1 +
1
9
1 2 3
S
1
4
5 6
0
1 2 3
S
2 +
1 S
2
0
0 0 0
D
0
0 4 5
3
6 0 8
0
1 2 3
D + 1 D
+
3 D + 2
Quotient(Upper 4-digit) Lower 4-digit
Remainder
(Upper 4-digit)
Lower 4-digit
.
.
7
Other places than specified will be regarded as 0