Direct

References the given memory location which contains the wanted value.

// Adds value at memory location 12
ADD 12

Immediate

References the given value itself.

// Adds value 12
ADD 12

Note: limited in bit size due to mnemonic structure:

[
	opcode,
	memory addressing mode,
	operand                 <-- cannot take full advantage of bit size
]

Indirect

References the given memory location which references a memory location which contains the wanted value.

// Adds value at memory location represented in memory location 12
// (12: 47 -> 47: 15) = 15
ADD 12

Why? Computer RAM registers only have a limited storage, this is much more constricting on 8-bit computers which only have 256-bits.

Indirect memory addressing allows referencing memory outside the given block.

If we could only ever use direct addressing, there would be no point putting any more physical memory into your machine beyond 4 bits, as we could not physically reference the memory locations beyond address 15 (1111).

Indexed

References the index register memory location with the given memory location as an offset, containing a set of continuous data in memory.

// Adds value at index memory location plus memory location 12
// (IR = 15 | (15 + 12 = 27): 74)
ADD 12

Example

Memory LocationData
0LDC 0
1ADD 1
2ADD 2
3ADD 3
4ADD 5
5OUT
61
72
83
94
105

Index register = 5