We need to access specific memory locations (variables, data structures). Embedding the memory address directly in the instruction allows the CPU to access that fixed location.
Direct Addressing specifies the exact memory address of the operand within the instruction. The CPU reads/writes to that specific memory location.
- Instruction includes the memory address (e.g., 1234h)
- CPU fetches the instruction, extracts the address
- CPU performs a memory read/write to that address
- Example:
MOV AX, [1234h]— loads data from memory address 1234h into AX - Requires one memory access (in addition to instruction fetch)
- Simple and intuitive — address is fixed at compile time
- Limited address range: address size limited by instruction format
- Used for accessing global variables, fixed data structures
- Slower than register addressing (requires memory access)
- Built from: Addressing Mode, Memory Address
- Contrasts with: Immediate Addressing — value in instruction, not address
- Contrasts with: Indirect Addressing — address in register, not instruction
- Related: Memory, Effective Address
- Address is fixed at compile time (can’t change at runtime)
- Limited address range (e.g., 16-bit address = 64KB max)
- Position-independent code can’t use direct addressing (addresses change)