10 - 67
10.6 Index Register(Z) / Standard Device Resister(Z)
10.6.4 Switching scan/low speed exec. to Interrupt/fixed scan exec.
10
DEVICE EXPLANATION
(b) When "High-speed execution" is selected
1) When switching from scan/low speed execution type program to
interrupt/fixed scan execution type program
The CPU module does not save/restore the index register value.
2) When switching from interrupt/fixed scan execution type program to
scan/low speed execution type program
If data is written to index registers by using an interrupt program/fixed scan
execution type program, the values of index registers used for an scan/low
speed execution type program will be corrupted.
Before writing data to index registers by using an interrupt program/fixed scan
execution type program, use the ZPUSH/ZPOP instruction to save/restore the
data.
Figure 10.63 Index register saving (protection)/restoration (When "High-speed execution" is selected)
Figure 10.64 When data is written to index register by interrupt/fixed scan execution type program
Execution program
Index register value
Index register storage
area
For scan/low speed
execution type program
Scan/low speed
execution type
program
Z0=1
Z0=0
Switching Reset
Scan/low speed
execution type
program
Interrupt
program/Fixed
scan execution
type program
Transferred Transferred
Z0=1
Z0=1 to Z0=3
Z0=0 Z0=0
Z0=0
Z0=3
: For interrupt program, Z0 is changed to 3.
SM400
ZPOP
SM400
IRET
I0
The points after D0 stores
the data (Z0 to 15).
The data after D0 is stored
in points (Z0 to 15).
ZPUSH D0
D0