9618_s21_qp_12
A paper of Computer Science, 9618
Questions:
8
Year:
2021
Paper:
1
Variant:
2

Login to start this paper & get access to powerful tools

1
2
4
The table shows part of the instruction set for a processor. The processor has one general purpose register, the Accumulator (ACC), and an Index Register (. Instruction Explanation Opcode Operand LDM #n Immediate addressing. Load the number n to ACC LDD Direct addressing. Load the contents of the location at the given address to ACC STO Store contents of ACC at the given address ADD Add the contents of the given address to the ACC INC Add 1 to the contents of the register (ACC or DEC Subtract 1 from the contents of the register (ACC or CMP Compare the contents of ACC with the contents of JPE Following a compare instruction, jump to if the compare was True JPN Following a compare instruction, jump to if the compare was False JMP Jump to the given address 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 # denotes a denary number, e.g. #123 The current contents of the main memory and selected values from the ASCII character set are: Address Instruction ASCII code table (selected codes only) IN ASCII code Character CMP 100 A JPE 80 B CMP 101 C JPE 76 D JMP 80 LDD 102 INC ACC STO 102 JMP 70 LDD 102 DEC ACC STO 102 JMP 70 … Complete the trace table for the program currently in main memory when the following characters are input: A D Do not trace the program any further when the third input is required. Instruction address ACC Memory address Some bit manipulation instructions are shown in the table: Instruction Explanation Opcode Operand AND #n Bitwise AND operation of the contents of ACC with the operand AND Bitwise AND operation of the contents of ACC with the contents of XOR #n Bitwise XOR operation of the contents of ACC with the operand XOR Bitwise XOR operation of the contents of ACC with the contents of OR #n Bitwise OR operation of the contents of ACC with the operand OR Bitwise OR operation of the contents of ACC with the contents of can be an absolute address or a symbolic address # denotes a denary number, e.g. #123 The contents of the memory address 300 are shown: Bit Number The contents of memory address 300 represent an unsigned binary integer. Write the denary value of the unsigned binary integer in memory address 300. An assembly language program needs to test if bit number 2 in memory address 300 is a 1. Complete the assembly language instruction to perform this test. #4 An assembly language program needs to set bit numbers 4, 5, 6 and 7 to 0, but keep bits 0 to 3 with their existing values. Write the assembly language instruction to perform this action.
5
6
7
8