Chapter 6 Instruction Details
XBC E-Type Main Unit
6-168
Ver. 1
6.28.8 DIVU, DIVUP, DDIVU, DDIVUP
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)
DIVU(P)
DDIVU(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
Data to be divided by S2
WORD/DWORD
S2
Data to be divided by S1
WORD/DWORD
D
Address to save operation result in
WORD/DWORD
[Flag Set]
Flag
Description
Device
Number
Error
To be set if S2’s value is 0.
F110
Zero
To be set if operation result is Zero.
F111
1) DIVU (Unsigned Binary Divide)
(1) Saves the result of word data S1 divided by S2, the quotient in D (16-bit), the remainder in D+1.
(2) Performs Unsigned Operation.
2) DDIVU (Unsigned Binary Double Divide)
(1) Saves the result of word data (S1+1,S1) divided by (S2+1,S2), the quotient in (D+1,D), the remainder in
(D+3,D+2).
(2) Performs Unsigned Operation.
3) Program Example
(1) For P1000=’5559’ and P1100=’5’, Input Signal is changed from Off to On status, the quotient of Unsigned
division ‘1111’ is saved in P1200 and the remainder ‘4’ is saved in P1201.
DIVU P1000 P1100 P1200
P00000
(D)DIVU
P S1 S2
(D)DIVUP
S1 S2
means
DIVU/DDIVU
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...