Addressing Modes
Immediate, Register, Direct, Indirect, Implied.
In the 8085 microprocessor, an addressing mode defines how the operand (data) of an instruction is accessed. Different instructions require data from different sources: it could be embedded in the instruction itself, held in a register, stored at a known memory location, or accessed indirectly through a pointer. Understanding addressing modes clarifies how each instruction retrieves its data and is a core topic for GATE and university exams.
Immediate Addressing Mode
In immediate addressing mode, the operand data is part of the instruction itself. The programmer writes the actual value (not an address) directly in the instruction. When the CPU fetches the instruction from memory, the data arrives along with the opcode in subsequent bytes. This is the fastest mode for loading constants because no extra memory access is needed to locate data.
Examples include MVI A, 30H (loads 30H into accumulator) and LXI H, 2050H (loads 2050H into HL pair). MVI is a 2-byte instruction (1 opcode + 1 data byte), while LXI is a 3-byte instruction (1 opcode + 2 address bytes). The data is fixed at the time of writing the program.
Register Addressing Mode
In register addressing mode, both the source and destination are CPU registers. No memory access is required to fetch the operand, making this the fastest execution mode. The entire operation occurs within the CPU's register file. Instructions in this mode are always 1 byte long because only the register identifiers need encoding in the opcode.
The instruction MOV B, C copies the content of register C into register B. Similarly, ADD B adds the content of B to the accumulator. All such operations complete in the minimum machine cycles possible.
Direct Addressing Mode
In direct addressing mode, the instruction contains the full 16-bit memory address of the operand. The CPU reads this address from the instruction bytes and then performs a separate memory access to fetch or store the actual data. These are 3-byte instructions: 1 opcode byte followed by 2 address bytes (low byte first, then high byte, in little-endian format).
Instructions like LDA 2050H (load accumulator from address 2050H), STA 3000H (store accumulator at 3000H), LHLD 4000H, and SHLD 5000H all use direct addressing. These are useful when the memory location of data is fixed and known at the time of programming.
Register Indirect Addressing Mode
In register indirect addressing mode, a register pair holds the memory address of the operand. The instruction does not contain the address directly; instead, it refers to the register pair that points to the data. This mode is highly flexible because the address in the register pair can change at runtime, allowing the instruction to work on different memory locations without modifying the code.
The HL register pair is the primary pointer for this mode. The notation M in 8085 assembly always means the memory location pointed to by HL. For example, MOV A, M reads the byte at address [HL] into A. Instructions LDAX B and LDAX D use the BC and DE pairs respectively to point to the source memory location. PUSH and POP also use SP indirectly.
Implied (Inherent) Addressing Mode
In implied addressing mode, the instruction itself specifies both the operation and the implied register or resource on which it operates. No explicit operand is mentioned in the instruction mnemonic because the operand is always the same fixed resource. These instructions are always 1 byte long.
CMA (complement accumulator), RAL (rotate accumulator left through carry), NOP, HLT, EI, DI, RET, XCHG, and DAD H are all examples of implied addressing. The CPU knows implicitly which register or flag is involved purely from the opcode.
Instruction Size and Execution Speed
A critical exam point is understanding how addressing mode affects instruction size in bytes and the number of machine cycles required. Larger instructions take more time to fetch from memory. The byte count directly influences execution time: 1-byte instructions (register, implied) are fastest, 2-byte instructions (immediate with 8-bit data) are moderate, and 3-byte instructions (direct, immediate with 16-bit data) are slowest. This is why tight loops often use register indirect or register modes rather than direct mode.
Given:
Instruction: LDA 2050H (Direct Addressing Mode)
Clock frequency = 3 MHz → T = 333 ns
LDA requires 13 T-states
Why this formula applies:
Execution time = Number of T-states × Clock period
LDA fetches 3 bytes (opcode + 2 address bytes) + 1 memory read = 4 memory operations
Formula:
Execution time = N_Tstates × T
Substitution:
Execution time = 13 × 333 ns
Calculation:
Execution time = 4329 ns ≈ 4.33 microseconds
For comparison: MOV A, B (Register mode) = 4 T-states
Time = 4 × 333 ns = 1332 ns ≈ 1.33 microseconds
Final Answer:
LDA (Direct) takes 4.33 µs vs MOV A, B (Register) at 1.33 µs at 3 MHz.
Register mode is ~3.25x faster than direct addressing for this case.Exam Tip: In GATE questions, when asked for the number of bytes in an instruction, remember: Immediate with 8-bit data = 2 bytes, Immediate with 16-bit data = 3 bytes, Direct = 3 bytes, Register and Implied = 1 byte, Register Indirect = 1 byte. LXI and LDA are 3-byte instructions; MVI is 2 bytes.
- Immediate mode: operand is embedded in the instruction bytes; no extra memory fetch for data.
- Register mode: operand is in a CPU register; fastest execution, 1-byte instruction, no memory access.
- Direct mode: instruction contains a 16-bit memory address; always a 3-byte instruction.
- Register Indirect mode: a register pair (HL, BC, DE, SP) holds the effective address; flexible and runtime-variable.
- Implied mode: the operand is implicit in the opcode; always 1 byte, no explicit operand field.
Quick Revision
- Five addressing modes in 8085: Immediate, Register, Direct, Register Indirect, Implied.
- Instruction byte count: Implied/Register = 1 B, Immediate (8-bit) = 2 B, Immediate (16-bit)/Direct = 3 B.
- M in 8085 assembly always means memory location pointed to by HL pair.
- LDAX B / LDAX D use BC / DE as indirect pointers; MOV A, M uses HL.
- Execution time formula: Time = N_Tstates × T = N_Tstates / f_clock.
- Register mode is fastest (4 T-states for MOV); Direct LDA takes 13 T-states.
- Exam trap: Do not confuse immediate mode (data in instruction) with direct mode (address in instruction pointing to data location).
8085 Addressing Modes Quiz
Test your ability to classify and apply the five addressing modes of the 8085 instruction set.
Q1.The instruction "MOV A, M" in 8085 uses which addressing mode?
Related Articles
8086 Addressing Modes
Based, Indexed, Based-Indexed, Relative.
9 min read
Rotate Instructions
RLC, RRC, RAL, RAR usage.
10 min read
Stack Instructions
PUSH, POP, XTHL, SPHL.
9 min read
16-bit Arithmetic
DAD, INX, DCX instructions.
11 min read
8085 Architecture Overview
8-bit ALU, registers, flags reduction.
4 min read