SLIDE 1
CSZone.co.uk
Click to advance · Arrow keys also work
CAIE 9618 · Paper 1 · Topic 1.4.2

Addressing Modes

Immediate · Direct · Indirect · Indexed · Symbolic — with memory diagrams

CSZone Cambridge International AS & A Level Computer Science 9618
Immediate Addressing

The Operand IS the Value

In immediate addressing, the operand in the instruction is the actual value to be used — not a memory address. Identified by the # prefix.
EXAMPLE
LDM #42
Loads the literal value 42 directly into the Accumulator. No memory lookup required.
CHARACTERISTICS
✓ Fast — no extra memory access
✓ Simple — value is fixed
✗ Cannot change value at runtime
Used for: initialising counters, constants
Direct Addressing

Operand is a Memory Address

In direct addressing, the operand is a memory address. The CPU reads from (or writes to) that specific location. One memory access required.
EXAMPLE
LDD 200
Loads the value stored at memory address 200 into the Accumulator. If Mem[200] = 37, ACC becomes 37.
CHARACTERISTICS
✓ Access any named variable
✓ Value can change between runs
✗ Requires one memory access
Used for: reading/writing variables
Indirect Addressing

Address Contains Another Address

In indirect addressing, the operand is an address that contains the actual address of the data. Two memory accesses are required. Like a pointer in a high-level language.
EXAMPLE
LDI 300
1. Read Mem[300] — say it contains 500
2. Read Mem[500] — load that value into ACC

Mem[300] = 500, Mem[500] = 99 → ACC = 99
CHARACTERISTICS
✓ Flexible — pointer can be changed
✓ Useful for dynamic data structures
✗ Two memory accesses → slower
Used for: pointers, dynamic arrays
Indexed Addressing

Base Address + Index Register

In indexed addressing, the effective address = operand + contents of the Index Register (IX). Allows sequential traversal of arrays.
EXAMPLE
LDX 100
If IX = 3, effective address = 100 + 3 = 103
Loads Mem[103] into ACC
Increment IX to access next array element
CHARACTERISTICS
✓ Ideal for arrays and tables
✓ IX can be incremented in a loop
✓ Base address stays fixed
Used for: array traversal, table lookups
Summary Comparison

All 5 Modes at a Glance

ModeCAIE InstructionEffective Value / AddressMemory Accesses
ImmediateLDM #nn (the literal value itself)0 (no memory lookup)
DirectLDD addrMem[addr]1
IndirectLDI addrMem[Mem[addr]]2
IndexedLDX addrMem[addr + IX]1
SymbolicJMP labelAssembler resolves label → address1
Exam Practice

Cambridge-style questions

Question 1 — Memory setup: Mem[200]=300, Mem[300]=75, Mem[203]=99, IX=3
For each instruction, state the value loaded into the Accumulator:
a) LDM #200   b) LDD 200   c) LDI 200   d) LDX 200
4 marks
1 mark
a) LDM #200 → ACC = 200 (immediate: the literal value 200)
1 mark
b) LDD 200 → ACC = Mem[200] = 300 (direct: value AT address 200)
1 mark
c) LDI 200 → ACC = Mem[Mem[200]] = Mem[300] = 75 (indirect: address of address)
1 mark
d) LDX 200 → Effective address = 200 + IX = 200 + 3 = 203. ACC = Mem[203] = 99
Common Mistakes

Don't lose easy marks

1
Saying LDM #200 loads the value at address 200 — # means immediate: the value IS 200. To load from address 200, use LDD 200. The # symbol is critical — never omit it or add it wrongly.
2
Saying indirect addressing accesses one memory location — indirect requires two memory accesses: first to get the pointer address, then to get the actual data. This makes it slower than direct addressing.
3
Saying indexed addressing changes the base address — indexed addressing changes the effective address by adding IX to the base, but the base address in the instruction stays fixed. IX is the variable part.
Topic Summary — 1.4.2

What You Need to Know

IMMEDIATE (#n)
Operand = value itself. LDM #n. Fastest — 0 memory accesses.
DIRECT (addr)
Value = Mem[addr]. LDD addr. 1 memory access.
INDIRECT (addr)
Value = Mem[Mem[addr]]. LDI addr. 2 accesses. Like a pointer.
INDEXED (addr + IX)
Effective = addr + IX. LDX addr. Used for arrays/loops.
SYMBOLIC (label)
Assembler converts label to address. JMP loop. Human-readable.
KEY EXAM TIP
# = immediate (value). No # = address. LDM #5 ≠ LDD 5.
CSZone

Next Video

1.5.1
Operating System Functions
Process Management · Memory · File System · I/O · Security
Head to CSZone.co.uk for the complete worksheet, quiz, and interactive tools