Cambridge AS Level Computer Science 9618 · 4.2 Assembly Language

Q20 · 9618/13/M/J/22 Q3

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

Q209618/13/M/J/22original Q3Structured · 10 marks
Question 3 from 9618/13/M/J/22

Worked solution

(a)

Memory: 100 = 101, 101 = 67, 102 = 104, 103 = 100, 104 = 68.

InstructionAccumulator
LDM #103103
LDD 102104
LDI 103101

LDM #103: the number itself, 103 [1]

LDD 102: the contents of address 102, 104 [1]

LDI 103: address 103 holds 100, so load the contents of address 100, 101 [1]

(b)

Choose two groups and describe each:

Group name, for example Input and output of data [1]

Description: takes an input from the user, or outputs the character for the value in ACC [1]

Group name, for example Arithmetic operations [1]

Description: carries out addition and subtraction [1]

Other groups that score: unconditional and conditional instructions (move to another instruction identified by a label or address), and compare instructions (compare the ACC with another value).

(c)

The value in memory is 00111101. Work out each result bit by bit:

InstructionWorkingResult
XOR B1111000000111101 XOR 1111000011001101
OR B0101010100111101 OR 0101010101111101
AND B1111111100111101 AND 1111111100111101

Draw a line from XOR B11110000 to 11001101 [1]

Draw a line from OR B01010101 to 01111101 [1]

Draw a line from AND B11111111 to 00111101 [1]

KEY IDEALDM loads the number, LDD loads from an address, and LDI loads from the address that is stored at an address.
TOTAL 10 marks

Official mark scheme

Mark scheme for 9618/13/M/J/22 question 3
VIDEO
▶ Whole paper

Video solution of the whole paper · by A Levels Academy Islamabad. 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.