Explain relative data addressing mode (with examples) available in microprocessors.
Relative Mode:
- Operand supplied is an offset, not the actual address. Added the contents of the CPU in its program counter register, to generate the needed address.
Illustration:
LDAC $5 is located at memory location 10, and this takes up two blocks of memory.
Therefore the value retrieved for this instruction will be 12 + 5, and will be stored into the accumulator.