OCR Computing A-Level Revision

Low Level Programming Languages

The Computer Architecture (3.8.a)

The accumulator is temporary storage to hold data being processed. Registers are locations within the CPU where data is stored. The program counter contains the memory address of the next instruction to be executed.

Addressing (3.8.b)

This section is all about providing the address for some data to be loaded into a register.

Immediate addressing is when the data in the address field is a constant. For example, the address field might contain INT 4.

Direct addressing is when the data in the address field is the address of a memory location, which holds a constant. For example, the address field might contain 9876, and the memory location 9876 might contain INT 4.

Indirect addressing is when the data in the address field is the address of a memory location, which holds the address of a memory location, which holds a constant. For example, the address field might contain 9876, and the memory location 9876 might contain the memory location 6543, and the memory location 6543 might contain INT 4.

Indexed addressing is when an "index" address is stored in a register, and then addresses are relative to the "index address". For example, if the index was 1000, then address 2 would be interpreted as address 1002. Indexed addressing is often used for arrays.

Relative addressing is where the address field is relative to the start of the "data area" of the program.

Note that the number of addresses is limited (by the size of the address field), so it is often not possible to avoid using relative addressing.

Mnemonics, Opcode and Symbolic Addressing (3.8.c)

Mnemonics are codes that are easily remembered which represent an opcode, such as ADD. In the instruction ADD 42, ADD is the opcode, and 42 is the operand. Symbolic addressing is the use of characters to represent the address of a location (e.g. CD).