VOOZH about

URL: https://www.geeksforgeeks.org/computer-organization-architecture/addressing-modes-8085-microprocessor/

⇱ Addressing modes in 8085 microprocessor - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Addressing modes in 8085 microprocessor

Last Updated : 22 Oct, 2025

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.

  • An addressing mode specifies how an instruction accesses data, whether directly, indirectly, or immediately, influencing how operands are fetched or manipulated.
  • Proper use of addressing modes in the 8085 helps optimize performance and memory usage while simplifying programming tasks.

Types of Addressing Modes

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.

1. Register Addressing Mode

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.

πŸ‘ register_addressing_mode_mov_a_b_

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.

2. Register Indirect Addressing Mode

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.

πŸ‘ register_indirect_addressing_mode_mov_a_m_

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.

3. Implied / Implicit Addressing Mode

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.

πŸ‘ implicit_implied_addressing_mode_cma_

Examples:

  • CMA β†’ Complements the contents of the accumulator.
  • RRC β†’ Rotates accumulator right by one bit.
  • RLC β†’ Rotates accumulator left by one bit.

4. Relative Addressing Mode

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).

πŸ‘ relative_addressing_mode_jmp_label_

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.

5. Indexed Addressing Mode

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.

πŸ‘ indexed_addressing_mode_base_offset_

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.

6. Memory-Mapped I/O Addressing Mode

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.

πŸ‘ memory_mapped_i_o_addressing_mode_mov_m_a_

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.

Usage of Addressing Modes

  • Flexibility: Addressing modes let programmers choose the best way to access data based on its type and size, adapting to different tasks easily.
  • Memory Optimization: They enable efficient use of memory by minimizing address storage and reducing memory accesses, especially with indirect and indexed addressing.
  • Performance Optimization: By lowering the number of memory accesses, addressing modes speed up program execution and improve processor efficiency.
  • Reduced Code Size: Using efficient addressing modes helps write more compact code with fewer instructions.
Comment

Explore