Past exam question: 2081 Chaitra (Regular), Q2(b)
Open in the Padhaiko appQuestion
Explain briefly about different types of addressing mode used in 8085 with suitable example.
Solution
The Five Addressing Modes of Intel 8085:
- Immediate Addressing Mode: The data operand is specified directly within the instruction bytes following the opcode (2-byte or 3-byte instructions).
- Example:
MVI A, 45H(Loads immediate byte 45H into accumulator). - Example:
LXI H, 2050H(Loads 16-bit address 2050H into HL register pair).
- Example:
- Register Addressing Mode: The operands reside entirely within the internal general-purpose registers (A, B, C, D, E, H, L). No memory bus access is required.
- Example:
MOV A, B(Copies contents of register B into accumulator A). - Example:
ADD C(Adds contents of register C to accumulator).
- Example:
- Direct Addressing Mode: The 16-bit physical memory address of the operand is explicitly provided as the second and third bytes of the instruction.
- Example:
LDA 2050H(Loads data byte from memory location 2050H into accumulator). - Example:
STA 3000H(Stores accumulator byte at memory location 3000H). - Example:
IN 01H(Reads 8-bit port address 01H directly).
- Example:
Indirect and Implied Addressing Modes:
- Register Indirect Addressing Mode: The 16-bit memory address where the operand is stored is held inside a register pair (primarily the HL pair, designated as memory pointer
M, or BC/DE withSTAX/LDAX).- Example:
MOV A, M(Copies byte from memory address pointed to by HL into accumulator). - Example:
ADD M(Adds byte from memory address [HL] to accumulator). - Example:
STAX B(Stores accumulator at memory address pointed to by BC pair).
- Example:
- Implied / Implicit Addressing Mode: The opcode itself implicitly specifies the operand(s); no explicit operand is mentioned in the instruction mnemonics.
- Example:
CMA(Complements the accumulator; operand is implicitly A). - Example:
RLC(Rotates accumulator left by 1 bit; operand is implicitly A). - Example:
STC(Sets the carry flag; operand is implicitly CY).
- Example:
Summary Table:
| Addressing Mode | Operand Location | Example Instruction | Byte Length |
|---|---|---|---|
| Immediate | In instruction bytes | MVI A, 32H | 2 bytes |
| Register | In CPU registers | MOV A, B | 1 byte |
| Direct | Specified 16-bit address | LDA 2050H | 3 bytes |
| Register Indirect | Address in register pair (HL) | MOV A, M | 1 byte |
| Implied | Implicit in opcode | CMA | 1 byte |
Answer:
8085 supports 5 addressing modes: Immediate (MVI A, 45H), Register (MOV A, B), Direct (LDA 2050H), Register Indirect (MOV A, M), and Implied/Implicit (CMA).