9618/11/M/J/24 question 4: worked solution (May/June 2024, paper 11)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 4.2 Assembly Language Worked solution from the Processor Fundamentals Paper 1 Theory Fundamentals booklet, Part 2 of 3. Q27 9618/11/M/J/24 original Q4 Structured · 7 marks Worked solution (a) Work through each program with the memory shown (ACC starts at 12, IX = 1). Program Working ACC content 1 LDD 20 loads 2; ADD #2 gives 4 4 2 LDX 22: address 22 + 1 = 23, which holds 5 5 3 LDI 25: address 25 holds 22, address 22 holds 3; INC ACC gives 4; SUB 22 (3) gives 1 1 4 LDD 19 loads 24; LDM #5 loads 5; LDM #25 loads 25 25 Program 1 = 4 [1] Program 2 = 5 [1] Program 3 = 1 [1] Program 4 = 25 [1] (b) ACC starts as 10011010 each time. Program Working ACC content 1 10011010 AND 11111111 10011010 2 10011010 XOR 01001111 11010101 3 #30 is 00011110; 10011010 OR 00011110 10011110 Program 1 = 10011010 [1] Program 2 = 11010101 [1] Program 3 = 10011110 [1] KEY IDEA Work out the address each addressing mode uses, then do the operation. TOTAL 7 marks Official mark scheme VIDEO ▶ Starts at Q4 (50:56) Starts at Q4 (50:56) · by Pseudocode Pro. Tap the picture to open it on YouTube.