9618/12/M/J/25 question 7: worked solution (May/June 2025, paper 12)

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. Q32 9618/12/M/J/25 original Q7 Structured · 8 marks Worked solution (a)(i) Run the program from address 100, writing only what changes. LDD 10 loads 12. ADD 12 adds 10 to give 22. STO 11 stores 22 at address 11. CMP 14 compares 22 with 22: true. JPE 107 jumps to 107. STO 10 stores 22 at address 10. Instruction address ACC 10 11 12 13 14 12 11 10 22 22 100 12 101 22 102 22 103 104 107 22 ACC 12 at 100 and 22 at 101 [1] Address 11 = 22 at 102 [1] Rows 103, 104 then 107 with address 10 = 22 [1] (a)(ii) Write one effect: 10 is loaded into ACC instead of the contents of address 10 (12). The sum would be 20, not 22, so the comparison fails and the program loops forever . [1] (a)(iii) Name a mode that is not in the table and describe it. Any one pair: Mode: Indirect [1] Description: the operand is the address of a memory location that contains the address of the data . [1] Other accepted pairs: Indexed (the address is the operand plus the contents of the Index Register) or Relative (the address is worked out from its distance from a base address). (b)(i) 11110000 OR 00001111 = 11111111 [1] (b)(ii) #30 is 00011110. 00011101 XOR 00011110 = 00000011 [1] KEY IDEA Trace one instruction at a time; a compare and a jump change which address runs next, not the ACC. TOTAL 8 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Virtual Help. Tap the picture to open it on YouTube.