Chapter 6 Instruction Details
XBC E-Type Main Unit
6-179
Ver. 1
6.29.4 DIVB, DIVBP, DDIVB, DDIVBP
Instruction
Area Available
Step
Flag
P M K F L T C S Z D.x R.x
Co
nst.
U N D R
Error
(F110)
Zero
(F111)
Carry
(F112)
DIVB(P)
DDIVB(P)
S1 O O O O O O O - O -
- O O O O O
4~6
O
O
-
S2 O O O O O O O - O -
- O O O O O
D O O O - O O O - O -
-
- O O O O
Operand
Description
Data Type
S1
BCD data to be divided by S2
WORD/DWORD
S2
BCD data to be divided by S1
WORD/DWORD
D
Address to save operation result in
WORD/DWORD
[Flag Set]
Flag
Description
Device
Number
Error
If the value of S1 and S2 is not of BCD format, if the value of S2 is 0
F110
Zero
To be set if operation result is Zero
F111
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
DIVB, DDIVB
P S1 S2
DIVBP, DDIVBP
S1 S2
means
DIVB/DDIVB
D
D
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...