9
-
62
CHAPTER9 DEVICES
9
9.6 Ind
ex R
egister
(Z)
9.6.3
Switching from the sca
n execution type/low-
spee
d execution type program
to the interrupt/fixed
scan e
xecution type progr
am
(b) When "High-speed execution" is selected
1) When switching from the scan execution type/low-speed execution type program
to the interrupt/fixed scan execution type program
The CPU module does not save/restore any index register values.
2) When switching from the interrupt/fixed scan execution type program to the scan
execution type/low-speed execution type program
If data are written to the index register by the interrupt/fixed scan execution type program, the values of the
index register used in the scan execution type/low-speed execution type program will be corrupted.
*1: The Z0 value is changed to 3 in the interrupt program.
When writing data to the index register by the interrupt/fixed scan execution type program, use the ZPUSH or
ZPOP instruction to save and restore the data.
Figure 9.67 Saving and restoring index register data (when "High speed execution" is selected)
Figure 9.68 Writing data to the index register in the interrupt/fixed scan execution type program
Execution program
Index register value
Save area of index
register
for scan/low-speed
execution type program
Scan/low-speed
execution type
program
Z0=1
Switching
Restored
Interrupt/fixed scan
execution type
program
Passed
Passed
Scan/low-speed
execution type
program
Z0=0
Z0=0
Z0=0
Z0=0
Z0=0
Z0=3
Z0=1
Z0=3
*
ZPUSH D0
SM400
ZPOP D0
SM400
IRET
I0
Data in Z0 to Z15 are
stored in the area
addressed from D0.
Data in the area
addressed from D0 are
stored in Z0 to Z15.