4-8
Programming Instructions Overview
Publication 1762-RM001C-EN-P
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.
Indirect
ADD
ADD
Add
Addresses
Source A
N7:[N7:3]
Source B
25
Dest
N15:[N7:3]
In this example, the controller uses the following addresses:
Operand
Base Address
Source A
N7:0
Destination
N7:0
Working
Addresses
Offset Value in N7:3
20
20
ADD
ADD
Add
Source A
N7:20
Source B
25
Dest
N15:20
Working Address
N7:20
N15:20