Skip to content

Addressing Modes: Immediate, Direct, Indirect and Indexed

1.2.4 Types of programming language · Paper 1 · 4 flashcards · 3 questions

When an instruction needs to access data, it must specify WHERE that data is. Different addressing modes provide different ways to specify the location.

Definition
Addressing modes are the different methods used to specify the location of an operand (the data an instruction operates on).

Immediate Addressing

Definition
In immediate addressing, the operand IS the actual value to be used - no memory lookup needed.
Immediate Addressing Examples:
assembly
ADD #5    // Add the literal value 5 to accumulator
LDA #100  // Load the literal value 100 into accumulator

The # symbol indicates immediate addressing. The value 5 or 100 is used directly.

Direct Addressing

Definition
In direct addressing, the operand specifies the memory address where the data is stored.
Direct Addressing Examples:
assembly
ADD 50    // Add the value STORED AT address 50 to accumulator
LDA 100   // Load the value STORED AT address 100 into accumulator

If address 50 contains the value 7, then ADD 50 adds 7.

Indirect Addressing

Definition
In indirect addressing, the operand points to a memory location that contains the ADDRESS of the actual data.
Worked Example: Indirect Addressing
Key Point
Memory addressValue stored
5075
7542
assembly
LDA @50    // indirect addressing, @ symbol
Key Point
Step-by-step:
1. Look at address 50 → find value 75
2. Use 75 as the actual address
3. Look at address 75 → find value 42
4. Load 42 into accumulator

Result: Accumulator = 42

Indexed Addressing

Definition
In indexed addressing, the final address is calculated by adding a base address to a value in an index register.
Worked Example: Indexed Addressing
Key Point
ItemValue
Base address100
Index register (X)3
Effective address100 + 3 = 103
assembly
LDA 100,X

Action: Load value from address 103 into accumulator.

Why is this useful? Perfect for arrays - the base address is where the array starts, and the index moves through each element.
Key Point
X valueInstructionAddress usedValue loaded
0LDA 100,X10010
1LDA 100,X10120
2LDA 100,X10230

Addressing Modes Summary

Key Point
Immediate
• Operand Contains: The actual value
• Example: ADD #5
• Use Case: Constants, fixed values

Direct
• Operand Contains: Address of data
• Example: ADD 50
• Use Case: Simple variables

Indirect
• Operand Contains: Address of address
• Example: ADD @50
• Use Case: Pointers, dynamic access

Indexed
• Operand Contains: Base + index
• Example: ADD 100,X
• Use Case: Arrays, tables
Exam Tip
Memory Tip:
• Immediate = the value is RIGHT THERE in the instruction
• Direct = go DIRECTLY to that address for the value
• Indirect = indirect route - address gives you another address
• Indexed = base + index (like array access)