Cambridge AS Level Computer Science 9618 · 4.2 Assembly Language

Q19 · 9618/12/O/N/21 Q8

Worked solution from the Processor Fundamentals Paper 1 Theory Fundamentals booklet, Part 2 of 3.

Q199618/12/O/N/21original Q8Structured · 15 marks
Question 8 from 9618/12/O/N/21

Worked solution

(a)(i)

MAR and MDR each score up to 2.

MAR stores the address of the next instruction to be fetched [1]

This address is copied from the Program Counter, and the data at it is then fetched [1]

MDR stores the data fetched from the address in MAR [1]

The data is then copied to the Current Instruction Register [1]

(a)(ii)

Any one of: Program Counter (PC), Current Instruction Register (CIR), Status Register, Interrupt register [1]

(b)(i)

Do each operation bit by bit. Address 101 = 11110000, 104 = 11111111, 102 = 00001111.

Current contents of the ACCInstructionNew contents of the ACC
01010101XOR 10110100101
11110000AND 10411110000
00001111LSL #411110000
11111111OR 10211111111

XOR 101: 10100101 [1]

AND 104: 11110000 [1]

LSL #4: 11110000 [1]

OR 102: 11111111 [1]

(b)(ii)

Choose one instruction from the table for each group:

Instruction GroupInstruction
Data movementLDM #2
Input and output of dataIN
Arithmetic operationsINC ACC
Unconditional and conditional instructionsJMP 100
Compare instructionsCMP 100

Input and output: IN (or OUT) [1]

Arithmetic: INC ACC (or INC IX) [1]

Unconditional and conditional: JMP or JPN with an address [1]

Compare: CMP with an address [1]

(b)(iii)

Any one of these modes:

Mode name: Indirect addressing [1]

Description: the address to be used is at the given address (the contents of that address is the address of the data) [1]

Other accepted answers: relative addressing (address is an offset from the current instruction), or indexed addressing (given address plus the Index Register), each with its matching description.

KEY IDEAMAR holds the address, MDR holds the data, and each bitwise instruction works on the ACC one bit at a time.
TOTAL 15 marks

Official mark scheme

Mark scheme for 9618/12/O/N/21 question 8
VIDEO
▶ Starts at Q8 (36:19)

Starts at Q8 (36:19) · by HyperDavester. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.