Mitsubishi Electronics C64 Home Safety Product User Manual


 
8. Function Commands
–, –P
- 167 -
(3) The positive/negative of the data in S1, S2, S and D is determined with the highest-order bit
(B15).
B15
Judgment of
positive/negative
0 Positive
1 Negative
(4) The carry flag will not turn ON if the 0 bit underflows.
Execution conditions
The execution conditions for -, -P are as shown below.
Subtraction command OFF
-
ON
Executed per scan
Executed per scan
-P
Program example
(1) Program to subtract the D10 BIN data from D3 and output to D20.
Coding
No. of
steps
Com-
mand
Device
10 LD M0
11 - D3 D10 D20
D10
D3 D20
M0
(ON)
10
-
15
(2) Program to output the difference of the timer T3 setting value and current value to D20 BCD data.
Coding
No. of
steps
Com-
mand
Device
10 LD X3
11 OUT T3
K18000
13 LD M0
14 MOV
K18000
D2
17 - D2 T3 D3
21 BCD D3 D20
X3
(ON)
10
T3 K18000
M0
MOV
K18000 D2
-
T3D2
D3
BCD D3
D20
13
24