Mitsubishi Electronics C64 Home Safety Product User Manual


 
8. Function Commands
D–, D–P
- 169 -
(2) -2147483648 to 2147483647 (BIN 32-bit) can be designated in S1, S2 and S.
(3) The positive/negative of the data in S1, S2, S and D is determined with the highest-order bit
(B31).
B31
Judgment of
positive/negative
0 Positive
1 Negative
(4) The carry flag will not turn ON if the 0th bit underflows.
Execution conditions
The execution conditions for D-, D-P are as shown below.
Subtraction command OFF
D-
ON
Executed per scan
Executed per scan
D-P
Program example
(1) Program to subtract the D0, 1 data from the D10, 11 data when X1 turns ON, and output the
results to D99, 100. Program to subtract the D0, 1 data from D10, 11 data when X2 turns ON, and
output the results to D97, 98.
D-
D0
D10
D99
X1
10
D-
D0D10 D97
X2
15
Subtract D0, 1 from D10,11,
and store the results in D99,100
Subtract D0, 1 from D10,11,
and store the results in D97,98
Coding
No. of
steps
Com-
mand
Device
10 LD X1
11 D- D10 D0 D99
15 LD X2
16 D- D10 D0 D97
20