Publication 1762-RM001C-EN-P
Programming Instructions Overview 4-7
Example - Using Indirect Addressing to Duplicate Indexed
Addressing
In this section, an indexed addressing example is shown first. Then an
equivalent indirect addressing example is shown. Indexed addressing is
supported by SLC 500 and MicroLogix 1000 programmable controllers.
The MicroLogix 1200 and 1500 do not support indexed addressing. This
example is shown for comparison purposes.
Indexed Addressing Example
The following ADD instruction uses an indexed address in the Source A
and Destination addresses. If the indexed offset value is 20 (stored in
S:24), the controller uses the data stored at the base address plus the
indexed offset to perform the operation.
In this example, the controller uses the following addresses:
Operand Base Address Offset Value in S:24 Working Address
Source A N7:0 20 N7:20
Destination N15:0 20 N15:20
NOTE
In the SLC and ML1000 controllers, there are some
instructions that clear S:24 after the instruction completes.
For this reason, you must insure that the index register is
loaded with the intended value prior to the execution of
an indexed instruction.
ADD
Add
Source A #N7:0
Source B 25
Dest #N15:0
ADD ADD
Add
Source A N7:20
Source B 25
Dest N15:20
ADD
Indexed
Addresses
Working
Addresses