9618/13/M/J/25 question 5: worked solution (May/June 2025, 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. Q33 9618/13/M/J/25 original Q5 Structured · 9 marks Worked solution (a)(i) Run the program from address 500, writing only what changes. LDM #50 gives 50. DEC ACC gives 49. CMP 51 compares 49 with 48: false, so the program goes on to 504 (JMP 501). The first pass runs 500, 501, 502 and then 504. Second pass: DEC ACC gives 48. CMP 51 compares 48 with 48: true, so JPE 505 jumps. STO 50 stores 48 at address 50. SUB #10 gives 38. STO 51 stores 38 at address 51. Instruction address ACC 50 51 52 53 47 48 49 50 500 50 501 49 502 504 501 48 502 503 505 48 506 38 507 38 First four rows: ACC 50, 49, then 502 and 504 [1] Second pass rows 501 to 505: ACC 48, then address 50 = 48 [1] Row 506 ACC = 38 and row 507 address 51 = 38 [1] (a)(ii) Name two modes of addressing and describe each. Any two of these: Indirect : the operand points to the memory location that holds the address of the data. Indexed : the address of the data is the operand plus the contents of the Index Register (IX). Direct : the operand is the address of the data. Two modes named correctly [2] Two matching descriptions correct [2] (b) Clear the register first, then set only the top bit. AND B00000000 OR B10000000 AND with all 0s clears every bit (also accepted: AND #0 or AND &0) [1] OR with 10000000 sets only the most significant bit (also accepted: OR #128 or OR &80) [1] KEY IDEA A loop with a compare and a conditional jump may run the same instructions more than once, so list every pass in the trace. TOTAL 9 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Ismail Adeleke. Tap the picture to open it on YouTube.