Past-paper question · 2019 October-November · Paper 42 · Q5(a)

Question 5(a) 2019 · October-November · Paper 42 · 5 marks

Original past-paper question for 5(A)
Original past-paper question for 5(A)
Reveal official mark-scheme answer Official mark-scheme answer for 5(A)

Official answer for Question 5

Part (a)

Question 1

mark for each shaded section

Question 5

  • LDD NUMBER
  • LSL
  • #2
  • STO NUMBER
  • END
✓
Label
✓
Op code
✓
Operand
✓
Comment
✓
LDD
✓
NUMBER
✓
// load contents of NUMBER
✓
LSL
✓
#2
✓
// perform shift to multiply by 4
✓
STO
✓
NUMBER
✓
// store contents of ACC in NUMBER
✓
END
✓
// end program
✓
NUMBER:
✓
B00110110
✓
9608/42
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November 2019
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w19_ms_42.pdf →

Show text version of question

Question 5

Part (a)

Question 5

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 LDI <address> the contents of this second address to ACC. Indexed addressing. Form the address from <address> + the contents of LDX <address> 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. Indexed addressing. Form the address from <address> + the contents of STX <address> the 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. Following a compare instruction, jump to <address> if the compare was JPE <address> True. Following a compare instruction, jump to <address> if the compare was JPN <address> False. AND #n Bitwise AND operation of the contents of ACC with the operand. Bitwise AND operation of the contents of ACC with the contents of AND <address> <address>. XOR #n Bitwise XOR operation of the contents of ACC with the operand. Bitwise XOR operation of the contents of ACC with the contents of XOR <address> <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 OR <address> <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 LSL #n right hand end. Bits in ACC are shifted n places to the right. Zeros are introduced on the LSR #n left 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

Part (a)

A programmer needs a program that multiplies a binary number by 4.

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

Write the program using the given instruction set.

Instruction Label Comment Op code Operand

// load contents of NUMBER

// perform shift to multiply by 4

// store contents of ACC in NUMBER

// end program

NUMBER: B00110110

[5]

Note:

# denotes immediate addressing

B
denotes a binary number, e.g. B01001010

& denotes a hexadecimal number, e.g. &4A

Question 16

Topic relevance

Why this question appears here

71% assigned-topic match · Information representation › Data representation

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

Keep practising this topic