A SERVICE OF

logo

8. Function Commands
S.STC, S.CLC
- 293 -
Program example
Program to add the D2 data and D0 data when M0 turns ON and to turn the carry flag (SM12) ON if
the results exceed 32767. If the results are 32767 or less, the carry flag is turned OFF.
> D1D0
24
> D1D2
M1
S.CLC
S.STC
M1
15
D0
D1
M0
10
D2
M1
22
Add the D2 and D0 data, and store the results in D1.
(D2 + D0 -> D1)
Turn carry flag ON when M1 turns ON.
+
Turn carry flag OFF when M1 turns OFF.
Turn M1 ON when added data (D0) exceeds the
results (D1) or the data to be added to exceeds the
results
Coding
No. of
steps
Com-
mand
Device
10 LD M0
11 + D2 D0 D1
15 LD> D2 D1
18 OR> D0 D1
21 OUT M1
22 LD M1
23 S.STC
24 LDI M1
25 S.CLC
26