Cambridge AS Level Computer Science 9618 · 4.2 Assembly Language

Q34 · 9618/13/O/N/25 Q6

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

Q349618/13/O/N/25original Q6Structured · 11 marks
Question 6 from 9618/13/O/N/25

Worked solution

(a)

Work on the bits, one instruction at a time:

AND 101: 0000 1111 AND 1010 1110 = 0000 1110

LDM #100: 100 = 64 + 32 + 4 = 0110 0100

XOR &F1: &F1 = 1111 0001. 0000 0001 XOR 1111 0001 = 1111 0000

CMP 101 only compares, so the ACC does not change.

Current contents of the ACCInstructionContents of the ACC after
0000 1111AND 1010000 1110
0000 0000LDM #1000110 0100
0000 0001XOR &F11111 0000
0001 0001CMP 1010001 0001

Row 1 correct [1]

Row 2 correct [1]

Row 3 correct [1]

Row 4 correct [1]

(b)

The MAR stores the address of the next instruction or data to be read from, or written to, memory [1]

The address is received from the Program Counter (PC) [1]

The MDR stores the data/instruction that has been read from (or is to be written to) the address in the MAR [1]

The instruction then passes to the CIR to be decoded and executed [1]

(c)

Loading data into the accumulator: data movement [1]

Incrementing the index register: arithmetic operations [1]

Branching to another address: conditional and unconditional jump (branch) instructions [1]

KEY IDEADo bitwise work bit by bit (CMP changes no register), and remember MAR holds addresses while MDR holds the data.
TOTAL 11 marks

Official mark scheme

Mark scheme for 9618/13/O/N/25 question 6
VIDEO
▶ Topic lesson

A lesson on this topic · by Craig'n'Dave. 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.