1. Theory Fundamentals
A section of Computer Science, 9608
Listing 10 of 304 questions
The 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 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. 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 screen the character whose ASCII value is stored in ACC. END Return control to the operating system. The diagram shows the current contents of a section of main memory and the index register: 0011 0010 0101 1101 0000 0100 1111 1001 0101 0101 1101 1111 0000 1101 0100 1101 0100 0101 0100 0011 0110 1001 Index register: 0 Show the contents of the Accumulator after the execution of the instruction: LDX 60 Accumulator: Show how you obtained your answer. Show the contents of the index register after the execution of the instruction: DEC IX Index register: Complete the trace table on the opposite page for the following assembly language program. LDD 100 ADD 102 STO 103 LDX 100 ADD 100 CMP 101 JPE 58 JPN 59 OUT INC IX LDX 98 ADD 101 OUT END IX (Index Register) Selected values from the ASCII character set: ASCII Code Character v w x y z { | }
9608_s16_qp_11
THEORY
2016
Paper 1, Variant 1
The 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 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. 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 screen the character whose ASCII value is stored in ACC. END Return control to the operating system. The diagram shows the current contents of a section of main memory and the index register: 0011 0010 0101 1101 0000 0100 1111 1001 0101 0101 1101 1111 0000 1101 0100 1101 0100 0101 0100 0011 0110 1001 Index register: 0 Show the contents of the Accumulator after the execution of the instruction: LDX 60 Accumulator: Show how you obtained your answer. Show the contents of the index register after the execution of the instruction: DEC IX Index register: Complete the trace table on the opposite page for the following assembly language program. LDD 100 ADD 102 STO 103 LDX 100 ADD 100 CMP 101 JPE 58 JPN 59 OUT INC IX LDX 98 ADD 101 OUT END IX (Index Register) Selected values from the ASCII character set: ASCII Code Character v w x y z { | }
9608_s16_qp_12
THEORY
2016
Paper 1, Variant 2
The following 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 Op code Operand Op code LDM #n 0000 0001 Immediate addressing. Load the denary number n to ACC. LDD 0000 0010 Direct addressing. Load the contents of the location at the given address to ACC. LDI 0000 0101 Indirect addressing. At the given address is the address to be used. Load the contents of this second address to ACC. LDX 0000 0110 Indexed addressing. Form the address from + the contents of the Index Register (. Copy the contents of this calculated address to ACC. LDR #n 0000 0111 Immediate addressing. Load number n to IX. STO 0000 1111 Store the contents of ACC at the given address. The following diagram shows the contents of a section of main memory and the Index Register (. Show the contents of the Accumulator (ACC) after each instruction is executed. IX LDM #500 ACC LDD 500 ACC LDX 500 ACC LDI 500 ACC Address Main Memory contents Each machine code instruction is encoded as 16-bits (8-bit op code followed by an 8-bit operand). Write the machine code for the following instructions: LDM #17 LDX #97 Using an 8-bit operand, state the maximum number of memory locations, in denary, that can be directly addressed. Computer scientists often write binary representations in hexadecimal. Write the hexadecimal representation for this instruction: A second instruction has been written in hexadecimal as: 05 3F Write the equivalent assembly language instruction, with the operand in denary.
9608_s17_qp_11
THEORY
2017
Paper 1, Variant 1
The following 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 Op code Operand Op code LDD 0001 0011 Direct addressing. Load the contents of the location at the given address to the Accumulator (ACC). LDI 0001 0100 Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC. LDX 0001 0101 Indexed addressing. Form the address from + the contents of the Index Register. Copy the contents of this calculated address to ACC. LDM #n 0001 0010 Immediate addressing. Load the denary number n to ACC. LDR #n 0001 0110 Immediate addressing. Load denary number n to the Index Register (. STO 0000 0111 Store the contents of ACC at the given address. The following diagram shows the contents of a section of main memory and the Index Register (. Show the contents of the Accumulator (ACC) after each instruction is executed. IX LDD 355 ACC LDM #355 ACC LDX 351 ACC LDI 355 ACC Address Main memory contents Each machine code instruction is encoded as 16 bits (8-bit op code followed by an 8-bit operand). Write the machine code for these instructions: LDM #67 LDX #7 Computer scientists often write binary representations in hexadecimal. Write the hexadecimal representation for the following instruction. A second instruction has been written in hexadecimal as: 16 4D Write the assembly language for this instruction with the operand in denary.
9608_s17_qp_12
THEORY
2017
Paper 1, Variant 2
The following 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 Op code Operand Op code LDM #n 0000 0001 Immediate addressing. Load the denary number n to ACC. LDD 0000 0010 Direct addressing. Load the contents of the location at the given address to ACC. LDI 0000 0101 Indirect addressing. At the given address is the address to be used. Load the contents of this second address to ACC. LDX 0000 0110 Indexed addressing. Form the address from + the contents of the Index Register (. Copy the contents of this calculated address to ACC. LDR #n 0000 0111 Immediate addressing. Load number n to IX. STO 0000 1111 Store the contents of ACC at the given address. The following diagram shows the contents of a section of main memory and the Index Register (. Show the contents of the Accumulator (ACC) after each instruction is executed. IX LDM #500 ACC LDD 500 ACC LDX 500 ACC LDI 500 ACC Address Main Memory contents Each machine code instruction is encoded as 16-bits (8-bit op code followed by an 8-bit operand). Write the machine code for the following instructions: LDM #17 LDX #97 Using an 8-bit operand, state the maximum number of memory locations, in denary, that can be directly addressed. Computer scientists often write binary representations in hexadecimal. Write the hexadecimal representation for this instruction: A second instruction has been written in hexadecimal as: 05 3F Write the equivalent assembly language instruction, with the operand in denary.
9608_s17_qp_13
THEORY
2017
Paper 1, Variant 3
The fetch-execute cycle is shown in register transfer notation. MAR PC - 1 MDR CIR There are three errors in the fetch-execute cycle shown. Identify the line number of each error and give the correction. Line number Correction Line number Correction Line number Correction A processor’s instruction set can be grouped according to their function. For example, one group is the input and output of data. Identify two other groups of instructions. 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 LDM #n Immediate addressing. Load the denary number n to ACC 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 denary 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 CMP #n Compare contents of ACC with denary number n 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 The current contents of the main memory, Index Register (and selected values from the ASCII character set are: Address Instruction LDM #0 STO 401 LDX 300 CMP #0 JPE 62 ADD 400 OUT LDD 401 INC ACC STO 401 INC IX JMP 52 END … … IX ASCII code table (Selected codes only) ASCII code Character A B C D E The ASCII character code for ‘A’ is 65 in denary. Convert the denary ASCII character code for ‘A’ into 8-bit binary. Convert the denary ASCII character code for ‘A’ into hexadecimal. The Unicode character code for ‘G’ is 0047 in hexadecimal. State, in hexadecimal, the Unicode character code for ‘D’.
9608_s19_qp_12
THEORY
2019
Paper 1, Variant 2
Questions Discovered
304