
Chapter 5. Application instructions
5-55
-
Execution conditions
2) Program example
-
Program which stores the division result of D0001 and D0002 at D0010, D0011 while P020 is on.
-
Program which stores the division result of D0001, D0002 and D0003,D0004 at D0010 ~ D0013
when P020 is switched on.
Input condition
DIVS, DDIVS
DIVSP, DDIVSP
Executed only once
Executed only once
Executed per scan
Executed per scan
DIVS D0001 D0002 D0010
P020
h78AB
hC678
h059B
D0001
hFFFE
=
÷
D0002
D0011
D0010
DDIVSP D0001 D0003 D0010
hF904
h5678
h0021
D0001
h8765
=
÷
D0002
D0003
D0004
hFFF5
h5E61
D0013
D0012
hFFFF
hFFCB
D0011
D0010
P020
Remainder
Quotient
Remainder
Quotient
(= -117156232)
(= 2197349)
(= –696735)
(= –53)
(= 30891)
(= –14728)
(= 1435)
(= –2)