Past-paper question · 2019 October-November · Paper 41 · Q2

Question 2 2019 · October-November · Paper 41 · 9 marks

Original past-paper question for 2
Original past-paper question for 2
Reveal official mark-scheme answer

Official answer for Question 2

Question 1

mark for each highlighted section

Question 9

✓
Op
✓
Label
✓
Operand
✓
Comment
✓
Code
✓
LOOP:
✓
LDD
✓
ANSWER
✓
// Load the value from ANSWER
✓
ADD
✓
NUMONE
✓
// Add the value from NUMONE
[1]
✓
STO
✓
ANSWER
[1]
✓
LDD
✓
COUNT
✓
// Load the value from COUNT
[1]
✓
INC
✓
ACC
✓
// Increment the Accumulator
[1]
✓
STO
✓
COUNT
[1]
✓
CMP
✓
NUMTWO
✓
// Is NUMTWO = COUNT?
[1]
✓
JPN
✓
LOOP
✓
// If false, jump to LOOP
[1]
✓
LDD
✓
ANSWER
✓
// Load the value from ANSWER
[1]
✓
// output ANSWER to the
✓
OUT
✓
screen
[1]
✓
END
✓
// End of program
✓
NUMONE:

Question 2

✓
NUMTWO:

Question 4

✓
COUNT:
✓
0
✓
ANSWER:
✓
0
✓
9608/41
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November 2019
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w19_ms_41.pdf →

Show text version of question

Question 2

The following table shows part of the instruction set for a processor, which has one general purpose register, the Accumulator (ACC), and an Index Register (IX).

Instruction Explanation Op code Operand LDM #n Immediate addressing. Load the number n to ACC. Direct addressing. Load the contents of the location at the given address to LDD <address> ACC. Indirect addressing. The address to be used is at the given address. Load the LDI <address> contents of this second address to ACC. Indexed addressing. Form the address from <address> + the contents of the LDX <address> 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. Indexed addressing. Form the address from <address> + the contents of the STX <address> Index Register. Copy the contents from ACC to this calculated address. ADD <address> Add the contents of the given address to the ACC. INC <register> Add 1 to the contents of the register (ACC or IX). DEC <register> Subtract 1 from the contents of the register (ACC or IX). JMP <address> Jump to the given address. CMP <address> Compare the contents of ACC with the contents of <address>. CMP #n Compare the contents of ACC with number n. JPE <address> Following a compare instruction, jump to <address> if the compare was True. JPN <address> Following a compare instruction, jump to <address> if the compare was False. AND #n Bitwise AND operation of the contents of ACC with the operand. AND <address> Bitwise AND operation of the contents of ACC with the contents of <address>. XOR #n Bitwise XOR operation of the contents of ACC with the operand. XOR <address> Bitwise XOR operation of the contents of ACC with the contents of <address>. OR #n Bitwise OR operation of the contents of ACC with the operand. Bitwise OR operation of the contents of ACC with the contents of <address>. OR <address> <address> can be an absolute address or a symbolic address. Bits in ACC are shifted n places to the left. Zeros are introduced on the right LSL #n hand end. Bits in ACC are shifted n places to the right. Zeros are introduced on the left LSR #n hand end. IN Key in a character and store its ASCII value in ACC. OUT Output to the screen the character whose ASCII value is stored in ACC. END Return control to the operating system.

Question 15

A
programmer writes a program that multiplies two numbers together and outputs the result. The

numbers are stored as NUMONE and NUMTWO.

The programmer has started to write the program in the following table. The comment column contains explanations for some of the missing program instructions and data.

Complete the program using the given instruction set.

Label Op code Operand Comment LOOP: // load the value from ANSWER // add the value from NUMONE

// load the value from COUNT // increment the Accumulator

// is NUMTWO = COUNT ? // if false, jump to LOOP // load the value from ANSWER // output ANSWER to the screen // end of program NUMONE: 2 NUMTWO: 4 COUNT: 0 ANSWER: 0

[9]

Question 16

Topic relevance

Why this question appears here

72% assigned-topic match · Hardware › Logic gates and logic circuits

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_w19_qp_41.pdf

Keep practising this topic