Mitsubishi Electronics E60 Video Game Controller User Manual


 
S.STC, S.CLC
- 185 -
Program example
Program to add the D2 data and D0 data, both D0 and D2 are plus 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.
> D1
D0
24
>
D1D2
M1
S.CLC
S.STC
M1
Turn M1 ON when
(addition data D0) > (addition results D1)
or (addition data D2) > (addition results D1).
15
D0
D1
M0
10
D2
M1
22
Add the D2 and D0 data,
and store the results in D1.
Turn carry flag ON when M1 turns ON.
+
Turn carry flag OFF when M1 turns OFF.
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 LD1 M1
25 S.CLC
26