High−level Instructions
3 − 80
Explanation of example
Divides the contents of data register DT10 by decimal constant DT20 when trigger R0 turns on. The quotient
is stored in data register DT30 and the remainder is stored in special data register DT9015/DT90015.
When the decimal number 15 is in DT10 and the decimal number 4 is in DT20, as shown below.
0
DT9015/
DT90015
····
Bit position
·····
DT10
15
000
12
0
11
000
8
0
7
000
4
0
3
111
0
1
Dividend [S1]: K15
····
Bit position
·····
DT20
15
000
12
0
11
000
8
0
7
000
4
0
3
010
0
0
Divisor [S2]: K4
····
Bit position
·····
DT30
15
000
12
0
11
000
8
0
7
000
4
0
3
001
0
1
Quotient [D]: K3
····
Bit position
·····
15
000
12
0
11
000
8
0
7
000
43
001
0
1
Remainder: K3
...
Description
The 16-bit data or 16-bit equivalent constant specified by S1 is divided by the 16-bit data or 16-bit equivalent
constant specified by S2.
The quotient is stored in D and the remainder is stored in the special data register DT9015 (DT90015 for
FP0 T32/FP0R/FPΣ/FP−X/FP2/FP2SH/FP10SH).
Dividend data
Quotient
(S1)
(D)
÷
(S2)
Divisor
Remainder
(DT9015/DT90015)
....
With the FP0 T32/FP0R/FPΣ/FP−X/FP2/FP2SH/FP10SH and FP0 C10, C14, C16, C32/FP−e, the
numbers of the special data registers are different.
Type Special data register
FP0 C10, C14, C16, C32/
FP−e
DT9015
FP0 T32/FP0R/FPΣ/FP−X/
FP2/FP2SH/FP10SH
DT90015
Flag conditions
・Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
・Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
・= flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
・Carry flag (R9009): Turns on for an instant when the negative minimum value K-32768 (H8000) is
divided by K-1 (HFFFF).