9618/13/M/J/24 question 3: worked solution (May/June 2024, paper 13)

Show as 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. Q29 9618/13/M/J/24 original Q3 Structured · 7 marks Worked solution (a) Work through each program (ACC starts at 2, IX = 50). Program Working ACC content 1 LDM #50; INC ACC gives 51; SUB #1 gives 50 50 2 LDI 51: address 51 holds 50, address 50 holds 48; ADD 52 (49) gives 97 97 3 LDR #2 sets IX = 2; LDX 50: address 52 holds 49; DEC ACC gives 48 48 4 LDD 52 loads 49; SUB 54 (6) gives 43; INC ACC gives 44 44 Program 1 = 50 [1] Program 2 = 97 [1] Program 3 = 48 [1] Program 4 = 44 [1] (b) ACC starts as 11111111 each time. Instruction Working ACC content 1 LSL #2: shift left 2 places, 0s on the right 11111100 2 XOR 100 (00001101) 11110010 3 AND 103 (00110111) 00110111 Instruction 1 = 11111100 [1] Instruction 2 = 11110010 [1] Instruction 3 = 00110111 [1] KEY IDEA Resolve each addressing mode to a value, then apply the operation one step at a time. TOTAL 7 marks Official mark scheme VIDEO ▶ Starts at Q3 (16:27) Starts at Q3 (16:27) · by Pseudocode Pro. Tap the picture to open it on YouTube.