Installation manual

Publication 1747-RM001G-EN-P - November 2008
D-2 Programming Instruction References
Understanding the Different Addressing Modes
The following descriptions will help you understand how to structure a
specific type of address.
Direct Addressing
The data stored in the specified address is used in the instruction. For example:
N7:0
ST20:5
T4:8.ACC
Indexed Addressing
You may specify an address as being indexed by placing the “#” character in
front of the address. When an address of this form is encountered in the
program, the processor takes the element number of the address and adds to it
the value contained in the Index Register S:24, then uses the result as the actual
address. For example:
#N7:10 where S:24 = 15
The actual address used by the instruction is N7:25.
Indirect Addressing
You may specify an address as being indirect by replacing the file number,
element number, or sub-element number with a [Xf:e.s] symbol. The word
address inside of the bracket is queried for a value. The queried value then
becomes the file, element, or sub-element portion of the indirect address. For
example:
B3:[N10:2] states that the element address of Bit file 3 is contained in
address N10:2. Therefore, if N10:2 contains the value 5, B3:[N10:2]
indirectly refers to address B3:5. Other examples include:
N7:[N7:0]
N7:[T4:0.ACC]
N[N7:0]:[N7:1]
C5:[N7:0]
Indexed Indirect Addressing
You may specify a combination of indirect and indexed addressing. The
processor first resolves the indirect portion of the address and then adds the
offset from the Index Register S:24 to come up with the final address. For
example: