Mitsubishi Electronics C64 Home Safety Product User Manual


 
8. Function Commands
FOR, NEXT
- 231 -
Program example
(1) Program to execute FOR to NEXT loop when X8 is OFF, and not to execute it when X8 is ON.
Coding
No. of
steps
Com-
mand
Device
10 LD X8
11 CJ P8
13 LDI M0
14 MOV K0 Z3
17 FOR K4
22 LDI M0
23 MOV Z3 D0Z3
26 INC Z3
28 NEXT
32 P8
33 LD X0A
34 OUT Y33
10
13
17
22
28
33
35
Caution
(1) To force an end to the repetitious execution of the FOR to NEXT loop during the execution of the
loop, insert a BREAK command.
(2) Use the EGP, EGF commands to conduct index qualification for the FOR to NEXT contact.
(3) Be sure not to execute the END (FEND) command after the execution of the FOR command but
before of the NEXT command.
(4) Always execute the FOR command prior to the NEXT command.
(5) Be sure not to insert the STOP command within the FOR to NEXT loop.