Worked solution from the Processor Fundamentals Paper 1 Theory Fundamentals booklet, Part 2 of 3.
LDX 110 reads address 110 + IX. CMI 102 compares ACC with the contents of the address held in 102 (that is, address 112, which holds 0). Blank cells mean no change.
| Instruction address | ACC | IX | 100 | 101 | 102 | 103 | 110 | 111 | 112 |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 112 | 4 | 1 | 4 | 0 | |||
| 75 | 0 | ||||||||
| 76 | 1 | ||||||||
| 77 | |||||||||
| 78 | |||||||||
| 79 | |||||||||
| 80 | |||||||||
| 84 | 2 | ||||||||
| 85 | 2 | ||||||||
| 86 | 0 | ||||||||
| 87 | 1 | ||||||||
| 88 | 1 | ||||||||
| 89 | 1 | ||||||||
| 90 | |||||||||
| 76 | 4 | ||||||||
| 77 | |||||||||
| 78 | |||||||||
| 79 | |||||||||
| 80 | |||||||||
| 81 | 6 | ||||||||
| 82 | 6 | ||||||||
| 83 | |||||||||
| 86 | 1 | ||||||||
| 87 | 2 | ||||||||
| 88 | 2 | ||||||||
| 89 | 2 | ||||||||
| 90 |
Rows 75 to 80 (IX = 0, ACC = 1, both compares False, jump to 84) [1]
Rows 84 to 90 (ACC = 2, 101 = 2, ACC = 0, then 1, 100 = 1, IX = 1) [1]
Rows 76 to 80 second time (ACC = 4, CMI is False, CMP 103 is True so no jump) [1]
Rows 81 to 83 (ACC = 6, 101 = 6, jump to 86) [1]
Rows 86 to 90 (ACC = 1, then 2, 100 = 2, IX = 2, stop at 90) [1]
XOR flips the bits where the operand has 1: 01010011 XOR 00011111.
01001100 [1]
Address 50 holds 01001101. 01010011 AND 01001101.
01000001 [1]
Shift left 3 places and fill the right with zeros: 01010011 → 10011000.
10011000 [1]
Address 51 holds 10001111. 01010011 OR 10001111.
11011111 [1]
| Description | Register transfer notation |
|---|---|
| Copy the address of the next instruction into the MAR | MAR ← [PC] |
| Increment the Program Counter | PC ← [PC] + 1 |
| Copy the contents of the MDR into the CIR | CIR ← [MDR] |
MAR ← [PC] [1]
PC ← [PC] + 1 [1]
CIR ← [MDR] [1]
▶ Whole paper
Video solution of the whole paper · by Audere Prep. 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.