Memory Addressing Modes of 8085
Memory Addressing Modes of 8085
Operand
Note: In the 8086, all the addresses are calculated with respect to the segment register contents.
DS is the data segment register.
23 00
Memory
22FF
+2300 43 4
2301
2302
2303 43
Accumulator
Fig, 1.9
8
Microprocessors
3. Indexed addressing mode
The indexed addressing mode is useful when different elements of a list or an
array are to be stored
in loop for performing the same set of operation. In this mode
The base of the array is specified in a register called base register
The index or distance of the element from the base of the array to be accessed in specified in
a register called indexed register
The sum of the contents of Base register and Index register is the address of the operand in
memory.
Let us assume that the ten numbers, X1, X, X3 ... X10 are stored in memory in consecutive locations
starting from 0300H. The address 0300H is the base of the array and will be stored in base register.
For the first element, the index register willcontain 0. To accessX5, the index register will contain 04
Fig. 1.10 shows this index addressing mode
Base Register Index Register
0300 04
Memory
0300 X1 Base location
0301 X2
0302 X3
0303 X4
X5
Address of operand
(0304 H) X6
X7
X8
X9
0310 X10
Fig. 1.10
Thus, the operation in loop may be performed as follows
Start: Load the base register with the base location of the array
Load the index register with 0
Loop: 'Perform operation
Increment the index register
Iftheindex register contents less than N(length of array)then branch to loop else continue