9618/11/O/N/23 question 8: worked solution (October/November 2023, paper 11)

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. Q25 9618/11/O/N/23 original Q8 Structured · 10 marks Worked solution (a) Write: the first pass creates the symbol table [1] (b)(i) Choose one instruction from each group, each with an operand: Data movement: LDR #50 or STO 201 [1] Arithmetic operation: ADD 100 or INC IX [1] Conditional instruction: JPE 96 [1] (b)(ii) Similarity: both load the contents of an address into the Accumulator [1] Difference: direct uses the address in the operand, whereas indexed adds the contents of IX to the operand and uses that calculated address [1] (b)(iii) Write one of: indirect addressing or relative addressing [1] (c)(i) AND gives 1 only where both bits are 1. 01001111 AND 10100101 = 00000101 [1] (c)(ii) Shift 3 places right with 0s on the left. 00010111 becomes 00000010 [1] (c)(iii) XOR gives 1 where the bits differ. 11110111 XOR 00100101 = 11010010 [1] KEY IDEA Learn the addressing modes and work bitwise AND, XOR and shifts bit by bit. TOTAL 10 marks Official mark scheme VIDEO ▶ Starts at Q8 (1:24:43) Starts at Q8 (1:24:43) · by Pseudocode Pro. Tap the picture to open it on YouTube.