Cambridge AS Level Computer Science 9618 · 4.2 Assembly Language

Q27 · 9618/11/M/J/24 Q4

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

Q279618/11/M/J/24original Q4Structured · 7 marks
Question 4 from 9618/11/M/J/24

Worked solution

(a)

Work through each program with the memory shown (ACC starts at 12, IX = 1).

ProgramWorkingACC content
1LDD 20 loads 2; ADD #2 gives 44
2LDX 22: address 22 + 1 = 23, which holds 55
3LDI 25: address 25 holds 22, address 22 holds 3; INC ACC gives 4; SUB 22 (3) gives 11
4LDD 19 loads 24; LDM #5 loads 5; LDM #25 loads 2525

Program 1 = 4 [1]

Program 2 = 5 [1]

Program 3 = 1 [1]

Program 4 = 25 [1]

(b)

ACC starts as 10011010 each time.

ProgramWorkingACC content
110011010 AND 1111111110011010
210011010 XOR 0100111111010101
3#30 is 00011110; 10011010 OR 0001111010011110

Program 1 = 10011010 [1]

Program 2 = 11010101 [1]

Program 3 = 10011110 [1]

KEY IDEAWork out the address each addressing mode uses, then do the operation.
TOTAL 7 marks

Official mark scheme

Mark scheme for 9618/11/M/J/24 question 4
VIDEO
▶ Starts at Q4 (50:56)

Starts at Q4 (50:56) · 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.