![]() |
VOOZH | about |
The 8085 microprocessor supports various addressing modes that define how operands (data) are specified and accessed from memory or registers, enabling efficient instruction execution. These addressing modes provide flexibility, allowing programmers to optimize performance, reduce memory usage, and simplify code complexity. By combining appropriate addressing modes with memory and performance optimizations, programmers can enhance the efficiency of their programs.
We have already discussed Immediate, Direct and Indirect Addressing Modes in detail; now, letβs explore the other types of addressing modes used in the 8085 microprocessor along with their features and examples.
Feature: Operand is stored and operated on, within CPU registers, making execution very fast since no memory access is required.
Description: In this mode, the operands are stored in the microprocessorβs registers. The instruction specifies the register where the data is stored or to which it should be transferred.
Examples:
- MOV A, B β Moves contents of register B to A.
- ADD B β Adds contents of B to A and stores the result in A.
- INR A β Increments the contents of A by 1.
Feature: Operandβs memory address is specified indirectly through a register pair, allowing flexible access to memory.
Description: Here, the address of the operand is stored in a register pair, and the instruction indirectly refers to the data through this pair. The actual operand resides in the memory location pointed to by the register pair.
Examples:
- MOV A, M β Moves data from memory (address in HL pair) to A.
- LDAX B β Loads accumulator with data from memory pointed by BC pair.
- STAX B β Stores accumulator contents in memory pointed by BC pair.
Feature: Operand is implied or predefined in the instruction, usually involving the accumulator.
Description: In this mode, the operand is not explicitly mentioned in the instruction. It is inherently defined by the instruction itself.
Examples:
- CMA β Complements the contents of the accumulator.
- RRC β Rotates accumulator right by one bit.
- RLC β Rotates accumulator left by one bit.
Feature: Operand is an offset relative to the program counter, commonly used for branching or looping.
Description: In this mode, the effective address is determined by adding a constant value (offset) to the contents of the program counter (PC).
Examples:
- MOV R0,#05H
- AGAIN: MVI A,#55H
- ADD A,R0
- JMP AGAIN
Here, JMP AGAIN uses Relative Addressing Mode by jumping to a location relative to the current PC value, enabling loops or conditional branches.
Feature: Effective address = base address + offset, making it useful for accessing arrays or tables.
Description: This mode is typically used to access sequential data structures in memory such as arrays or lookup tables. The base address is stored in a register, and an offset is added to it to calculate the final memory address of the operand.
Example:
- Suppose HL register pair holds the base address of an array.
- An offset is added to HL to access a specific element.
- This allows easy traversal of arrays or tables without manually calculating each address.
Feature: I/O devices are accessed through memory addresses instead of special I/O instructions.
Description: In this mode, I/O devices are treated as part of the memory. Each device is assigned a unique memory address, and the same instructions used for memory (like LDA, STA, MOV M, A) can also be used to read from or write to an I/O device. This simplifies communication with peripherals.
Examples:
- MOV M, A β Writes data from accumulator to the I/O device (memory-mapped address).
- MOV A, M β Reads data from the I/O device into accumulator.