Addressing modes (continued)
Displacement (also register indirect with displacement or based) mode: the effective address of the operand is the sum of the contents of a register and a value, called displacement, specified in the instruction.
Indexed and scaled indexed mode: works essentially as the register indirect.
- The register containing the address is called index register.
- The main difference between the register indirect and the indexed is that the contents of the index register can be scaled by a scale factor (e.g. 1, 2, 4, 8 or 16).
- The availability of the scale factor, along with the index register, permits scanning of data structures of any size, at any desired step.
Indirect scaled indexed mode: the effective address is the sum of the contents of the register and the scaled contents of the index register.
Indirect scaled indexed with displacement mode: essentially as the indirect scaled indexed, except that a displacement is added to form the effective address.
PC-relative mode: a displacement is added to the PC.
- The PC-relative mode is often used with branches and jumps.