Modes of Addressing Memory

Computer Science: OCR A Level, topic 2.4.7

Modes of Addressing Memory

Programs can be coded to use direct types of memory address. This allows program instructions to access high numbers of memory locations for storing and retrieving data and instructions.

Immediate addressing

Immediate addressing

  • In immediate addressing, the opcode is the actual value to be used.
  • The binary opcode of 00000101 would give the value of 5 to the CPU to work with if we used the immediate addressing mode.
  • This is a way to give the data directly to the processor so it doesn’t need to access another memory location.
Direct addressing

Direct addressing

  • In direct addressing, the opcode is the address for the memory location where the data can be found.
  • The instruction contains the memory address of the operand.
  • The value is not given directly. The CPU has to retrieve the value from the given memory location.
  • In Little Man Computer, this is the only type of addressing available.
Indirect addressing

Indirect addressing

  • In indirect addressing, the opcode is the location of the value to be used.
  • The instruction contains the address of a memory location that holds the actual address of the operand.
  • This is usually a register.
  • By using indirect addressing, the CPU can access a significantly higher number of addressable locations.
Indexed addressing

Indexed addressing

  • In indexed addressing, the opcode is one value that is added together with a value stored in the index register to give the location of the data to be used.
  • The index register value is a constant value that indicates the first memory location for an array of data items.
  • By adding the index register and the opcode value together, you get the address of the next location to get data from.

Test yourself on Modes of Addressing Memory

  • In which type of addressing is the opcode the actual value used by the machine instruction?

  • In which type of addressing does the opcode specify the address memory location of the value to be used?

Practise this topic for free