Worked solution from the Processor Fundamentals Paper 1 Theory Fundamentals booklet, Part 2 of 3.
Start each program with ACC = 50.
Program 1: LDD 50 loads 54. ADD #4 gives 58. ADD 54 adds the contents of address 54 (100): 58 + 100 = 158.
Program 2: LDI 53: address 53 holds 52, so load the contents of address 52, which is 50. DEC ACC gives 49. ADD 56 adds 50: 99.
Program 3: LDM #55 puts 55 in ACC. SUB #5 gives 50.
| Instructions | ACC content |
|---|---|
| LDD 50, ADD #4, ADD 54 | 158 |
| LDI 53, DEC ACC, ADD 56 | 99 |
| LDM #55, SUB #5 | 50 |
Program 1 = 158 [1]
Program 2 = 99 [1]
Program 3 = 50 [1]
Clearing means setting every bit to 0. [1]
Use a bitwise AND with a mask of all 0s, so every bit becomes 0 whatever it was before. Then you can compare the result with 0 to check the register is cleared. [1]
Instruction:
AND B00000000
The instruction AND B00000000 (or AND #0 or AND &00) [1]
▶ Whole paper
Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.