DVP-ES2/EX2/SS2/SA2/SX2/SE&TP Operation Manual - Programming
API
Mnemonic Operands Function
115
DIV16
DIV32
P
16-bit binary division
32-bit binary division
Type
OP
Bit Devices Word devices Program Steps
X Y M S K H KnX
KnY
KnM
KnS
T C D E F
DIV16, DIV16P: 7 steps
DIV32, DIV32P: 13 steps
SS2
SX2
SS2
SX2
SS2
SX2
Operands:
S
1
: Dividend S
2
: Divisor D: Quotient
Explanations:
1. DIV16 and DIV16P are 16-bit instructions. DIV32 and DIV32P are 32-bit instructions.
2. The singed binary value in S
1
is divided by the signed binary value in S
2
, and the quotient is
stored in D. It is not a normal algebraic regulation. Notice the sign bits in S
1
, S
2
, and D in 16-bit
binary division and 32-bit binary division.
3. If the divisor is 0, the instruction will not be executed, M1067 and M1068 will be ON, and the
error code in D1067 will be H0E19.
4. The models which are supported are DVP-ES2/EX2 v. 3.22, DVP-SS2 v. 3.20, DVP-SA2/SX2
v. 2.66, and DVP-SE v. 1.60 (and above).
5. 16-bit binary division
b15................b0
/
=
b15................b0
b15 is a sign bit. b15 is a sign bit.
b15 is a sign bit.
S
1
D
S
2
b15................b0
If D is a bit device, users can use K1~K4, and form 16 bits. D only occupies 16 bits.
6. 32-bit bianry division
+1
/
=
b15.....b0 b15.....b0 b15.....b0b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0
Quotient Remainder
S
1
S
2
S
1
S
2
+1
D D
+1
D
+3
D
+2
If D is a word device, users can use K1~K8, and forms 32 bits. D only occupies 32 bits.