Publication 1763-RM001C-EN-P - October 2009
88
Programming Instructions Overview
Indirect Addressing Example
An equivalent example using indirect addressing is shown below. In place
of using the index register, S:24, the user can designate any other valid
word address as the indirect address. Multiple indirect addresses can be
used within an instruction.
The following ADD instruction uses an indirect address in the Source A
and Destination addresses. If the indirect offset value is 20 (stored in
N7:3), the controller uses the data stored at the base address plus the
indirect offset to perform to instruction.
In this example, the controller uses the following addresses:
Operand
Base Address
Offset Value in N7:3
Working Address
Source A
N7:0
20
N7:20
Destination
N7:0
20
N15:20
Indirect
Working
ADD
Add
Source A
N7:[N7:3]
Source B
25
Dest
N15:[N7:3]
ADD
ADD
Add
Source A
N7:20
Source B
25
Dest
N15:20
ADD
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive