Question 2 2019 · October-November · Paper 43 · 9 marks
Reveal official mark-scheme answer
Official answer for Question 2
Question 1
mark for each highlighted section
Question 9
Question 2
Question 4
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
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
Question 16
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_43.pdf
