Question 8 2021 · May-June · Paper 42 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 8
Question 1
mark for each complete instruction, 1 mark for label LOOP
Question 5
Show text version of question
Question 8
The table shows assembly language instructions for a processor that has one general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction Explanation Label Op code Operand
LDM #n Immediate addressing. Load the number n to ACC Direct addressing. Load the contents of the location at LDD <address> the given address to ACC Indexed addressing. Form the address from <address> LDX <address> + the contents of the Index Register. Copy the contents of this calculated address to ACC LDR #n Immediate addressing. Load the number n to IX STO <address> Store the contents of ACC at the given address ADD <address> Add the contents of the given address to ACC INC <register> Add 1 to the contents of the register (ACC or IX) CMP #n Compare the contents of ACC with number n Following a compare instruction, jump to <address> if JPN <address> the compare was False Bits in ACC are shifted n places to the left. Zeroes are LSL #n introduced on the right hand end Bits in ACC are shifted n places to the right. Zeroes are LSR #n introduced on the left hand end Output to the screen the character whose ASCII value OUT is stored in ACC END Return control to the operating system <label>: <op code> <operand> Labels an instruction <label>: <data> Gives a symbolic address <label> to the memory location with contents <data>
Question 19
An algorithm stores a 3-character word. It takes each character in turn, multiplies its value by 2 and outputs the new character.
Complete the following assembly language program for the algorithm using the instruction set provided on the previous page.
Instruction Comment Label Op code Operand
// initialise Index Register to 0
LDX character // load character and multiply by 2
OUT // output the new character
INC IX // increment the Index Register
LDD count
STO count // loop 3 times
CMP #3
LOOP
END // end program
count: 0
character: B01000001
B10001110 // the 3-character stored word
B01000100
Question 20
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
Why this question appears here
99% assigned-topic match · Processor fundamentals › Assembly language
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_s21_qp_42.pdf
