9608_w18_qp_13
A paper of Computer Science, 9608
Questions:
8
Year:
2018
Paper:
1
Variant:
3

Login to start this paper & get access to powerful tools

1
2
The following table shows assembly language instructions for a processor which has one general purpose register, the Accumulator (ACC) and an Index Register (. Instruction Explanation Op code Operand LDD Direct addressing. Load the contents of the location at the given address to ACC. LDX Indexed addressing. Form the address from + 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 Store contents of ACC at the given address. ADD Add the contents of the given address to 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 contents of ACC with contents of . JPE Following compare instruction, jump to if the compare was True. JPN Following compare instruction, jump to if the compare was False. JMP Jump to the given address. OUT Output to the screen the character whose ASCII value is stored in ACC. END Return control to the operating system. State what is meant by relative addressing and indexed addressing. Relative addressing Indexed addressing The current contents of a general purpose register (are: X The contents of X represent an unsigned binary integer. Convert the value in X into denary. The contents of X represent an unsigned binary integer. Convert the value in X into hexadecimal. The contents of X represent a two’s complement binary integer. Convert the value in X into denary. Show the result on the general purpose register (after the following instruction is run. INC X The current contents of the main memory, Index Register (and selected values from the ASCII character set are provided with a copy of the instruction set. Instruction set Instruction Explanation Op code Operand LDD Direct addressing. Load the contents of the location at the given address to ACC. LDX Indexed addressing. Form the address from + 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 Store contents of ACC at the given address. ADD Add the contents of the given address to 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 contents of ACC with 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. OUT Output to the screen the character whose ASCII value is stored in ACC. END Return control to the operating system. Address Instruction LDD 96 CMP 97 JPE 32 LDX 86 CMP 98 JPN 27 OUT LDD 96 INC ACC STO 96 INC IX JMP 21 END … IX ASCII code table (selected codes only) ASCII code Character = & ( )
3
4
5
6