Question 6 2021 · May-June · Paper 43 · 6 marks
Reveal official mark-scheme answer
Official answer for Question 6
Question 6
Show text version of question
Question 6
The table shows assembly language instructions for a processor that has one general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction Label Op Operand Explanation code 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 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) Bitwise AND operation of the contents of ACC with the AND <address> contents of <address> Bitwise XOR operation of the contents of ACC with the XOR <address> contents of <address> Bitwise OR operation of the contents of ACC with the OR <address> contents of <address> Output to screen the character whose ASCII value is OUT stored in ACC Compare the contents of ACC with the contents of CMP <address> <address> CMP #n Compare the contents of ACC with number n Following a compare instruction, jump to <address> if JPE <address> the compare was True Following a compare instruction, jump to <address> if JPN <address> the compare was False JMP <address> Jump to the given address END Return control to the operating system <label>: <op Labels an instruction <operand> code> <label>: <data> Gives a symbolic address <label> to the memory location with contents <data>
An algorithm takes each letter of a stored 5-letter word and checks if the letter is upper case.
If the letter is upper case, it outputs the letter.
If the letter is not upper case, it converts the letter to upper case and then outputs it.
All ASCII upper case letters have 010 as the three most significant bits.
Assume each letter is alphabetic.
Question 17
Complete the assembly language program for the algorithm described using the instruction set provided on the previous page.
Instruction Comment Label Op code Operand
LDR #0 // load zero to IX
// load count and check if it is 5
JPE endP // jump to end
LDX word // load letter from indexed address word
// check if it is upper case CMP #0
JPE output // jump to output if it is upper case
LDX word // load letter from indexed address word
// convert to upper case
output: OUT // output the character
// increase count by 1
INC IX // increase IX by 1
JMP start // return to start
endP: end // end the program
word: B01001000
B01101111
B01110101
B01110011
B01100101
mask1: B00100000
mask2: B11011111
count: 0
Question 18
Why this question appears here
98% 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_43.pdf
