NonStop S-Series Server Description Manual (G06.24+)
TNS Execution Modes
HP NonStop S-Series Server Description Manual—520331-003
6-24
Indexing in the Data Segment
Indexing in the Data Segment
Indexing is used to reference memory locations relative to a data element in memory. 
A typical use is the accessing of an element in an array.
Generally, indexing is done as follows. An initial address is first calculated as 
described in the preceding two topics (any addressing mode as well as direct, indirect, 
and byte addressing is permitted). This initial address is then used as a base address 
for indexing. The indexing value, contained in an index register (referred to as “X”), is 
added to the initial address to provide the address of the referenced operand. This is 
shown in the upper part of Figure 6-15.
Any one of three registers in the register stack (R[5:7]) can be used as an index 
register. The register to be used for indexing is specified in the index register field 
(bits 5 and 6) in all memory reference instructions. (Note the instruction format in the 
lower part of the figure.) The index register field corresponds to register stack 
elements as follows: 
An index register can contain values from –32,768 through +32,767 to provide direct 
word and doubleword addressing of any location in the data area (all addressing is 
modulo 65,536). Byte addressing, as described in the preceding topic, applies only in 
the first half of the data segment.
The value in an index register is always treated as an element indexing value. That is, 
if a byte instruction is being executed, the content of an index register is treated as a 
byte offset; if a doubleword instruction is being executed, the content is treated as a 
doubleword offset. The next topic shows examples of word and byte indexing.
Index Register Field Index Register
0 X = no indexing
1X = R[5]
2X = R[6]
3X = R[7]










