250
Cycle Time/High-speed Processing Section 6-1
Programming Example 2
This examples show background execution when index register output is
specified, as is possible for MAX(182), MIN(183), and SRCH(181).
■ Traditional Programming without Background Execution
As shown below, the actual memory map address of the word containing the
maximum value is output to an index register.
■ Programming with Background Execution
With background execution, the actual memory map address of the word con-
taining the maximum value is output to A595 and A596. MOVL(498) is then
used the actual memory map address to the index register.
6-1-11 Sharing Index and Data Registers between Tasks
Sharing Index and Data Registers (IR/DR) between tasks is supported only by
CS1-H, CJ1-H, or CJ1M CPU Units. The normal setting is for separate regis-
ters for each task. The current setting can be confirmed in A09914.
Note 1. Shared Index and Data Registers can be used to eliminate the need to
store and load register contents between tasks when the same contents is
needed in two or more tasks. Refer to the section on index registers in the
MAX
D00000
D00100
D00200
a
MOV
,IR0
D00300
Execution condition
MAX(182) is executed completely as
soon as the execution condition “a”
turns ON, and the actual memory map
address of the word containing the
maximum value is output to IR0
The contents of the I/O memory word
indicated by the memory map
address in IR0 is copied to D00300.
RSET
a
SET
b
MAX
D00000
D00100
D00200
a A20200
MOV
,IR0
D00300
MOVL
A595
IR0
b A20200
RSET
b
Execution condition “b” is turned ON to
execute MOVL(498).
When execution condition “b”
is ON and the
Communications Port
Enabled Flag is ON,
MOVL(498) copies the actual
memory map address in
A595 and A596 to IR0.
MAX(182) execution is started if execution
condition “a” is ON and the Communications
Port Enabled Flag is ON. The actual memory
map address of the word containing the
maximum value is output to A595 and A596.
“a” is turned OFF so that MAX(182) will not
be executed the next cycle.
The contents of the I/O memory word
indicated by the memory map address in IR0
is copied to D00300.
Extra
processing
required to
move
address.
Execution
condition
Communications
Port Enabled Flag
Execution
condition
Communications
Port Enabled Flag