Instruction groups, addressing modes, the two-pass assembler, tracing, CPU performance and ports
Watch the whole lecture free
Make a free account to watch every lecture to the end: 5 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.
That was the teaching part. The rest of this lecture is free with an account: 5 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.
No password needed now: we email you a link to set one. Already have an account? Sign in, then come back to this page.
The teaching part (2 min) is free to watch. A free account opens the whole lecture: 5 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.
What this lecture covers
- The language the CPU almost speaks
- Instruction groups
- Addressing modes
- The same memory, four loads
Read the transcript of the teaching part
Last time
Before we start: last time, in Binary shifts and bit manipulation, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.
The language the CPU almost speaks
Machine code is just binary. Assembly language gives each instruction a short name, so a human can read it. An assembler translates it back to binary. Cambridge asks you to read it, trace it, and explain how it is translated. And three nearby topics come with it: what makes a CPU fast, and how devices plug in.
Instruction groups
Data movement: LDM, LDD, LDI, LDX, LDR, MOV and STO load and store data between memory and the accumulator. Arithmetic: ADD, SUB, INC and DEC. Comparison: CMP. Jumps: JMP, JPE and JPN. Input and output: IN and OUT. The program ends with END. Logic and bit manipulation: AND, OR, XOR, and shifts LSL and LSR.
Addressing modes
Immediate: the operand is the data itself. LDM hash 300 puts the number 300 in the accumulator. Direct: the operand is the address of the data. LDD 300 loads what is stored at 300. Indirect: the operand is an address that holds another address. LDI 300 follows the pointer. Indexed: add the index register to the operand to get the address.
The same memory, four loads
Address 300 holds 301, and address 301 holds 47. The index register holds 1. LDM hash 300 gives 300. LDD 300 gives 301, the contents of 300. LDI 300 reads 301 as an address, so it gives 47. LDX 300 uses 300 plus 1, which is 301, so it also gives 47.
How often it comes up
How often Cambridge has asked each part, counted by ExamYard from every past paper in its question bank: Instruction groups and addressing modes · Tracing an assembly language program.
The whole chapter: Processor Fundamentals.
Chapter 4: Processor fundamentals
- The processor, registers, buses and the fetch-execute cycle 6 min
- Binary shifts and bit manipulation 6 min
- Instruction groups, addressing modes, the two-pass assembler, tracing, CPU performance and ports 7 min
Also for A Level Computer Science 9618
Which topics come up most in A Level Computer Science 9618 past papers, counted from every paper since 2004: Paper 1 topic frequency, Paper 2 topic frequency.