Cambridge AS Level Computer Science 9618 · 4.2 Assembly Language

Q28 · 9618/12/M/J/24 Q5

Worked solution from the Processor Fundamentals Paper 1 Theory Fundamentals booklet, Part 2 of 3.

Q289618/12/M/J/24original Q5Structured · 7 marks
Question 5 from 9618/12/M/J/24

Worked solution

(a)

Work through each program (ACC starts at 10, IX = 0).

ProgramWorkingACC content
1LDI 15: address 15 holds 16, address 16 holds 12; SUB #1 gives 1111
2LDD 14 loads 10; ADD 11 adds 3 to give 1313
3LDM #11; ADD #3 gives 14; SUB 16 takes away 12 to give 22
4LDR #2 sets IX = 2; LDX 14: address 16 holds 12; ADD #2 gives 1414

Program 1 = 11 [1]

Program 2 = 13 [1]

Program 3 = 2 [1]

Program 4 = 14 [1]

(b)

ACC starts as 01000110 each time.

ProgramWorkingACC content
101000110 XOR 0000111101001001
2#29 is 00011101; 01000110 AND 0001110100000100
301000110 OR 1111111111111111

Program 1 = 01001001 [1]

Program 2 = 00000100 [1]

Program 3 = 11111111 [1]

KEY IDEARemember # means denary, so convert it to binary before a bitwise operation.
TOTAL 7 marks

Official mark scheme

Mark scheme for 9618/12/M/J/24 question 5
VIDEO
▶ Starts at Q5 (49:17)

Starts at Q5 (49:17) · by Pseudocode Pro. 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.