• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

The Problem

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.

Core Idea

Direct Addressing specifies the exact memory address of the operand within the instruction. The CPU reads/writes to that specific memory location.

How It Works

  1. Instruction includes the memory address (e.g., 1234h)
  2. CPU fetches the instruction, extracts the address
  3. CPU performs a memory read/write to that address
  4. Example: MOV AX, [1234h] — loads data from memory address 1234h into AX
  5. Requires one memory access (in addition to instruction fetch)
direct_addr Instr Instruction (MOV AX, [1234h]) Opcode | Address: 1234h Mem Memory Addr 1234h: data Instr->Mem read from 1234h CPU CPU AX ← data Mem->CPU

Key Properties

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

Connections

Edge Cases & Gotchas

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