1. Theory Fundamentals
A section of Computer Science, 9608
Listing 10 of 304 questions
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 Op code Operand LDD Direct addressing. Load the content of the location at the given address to ACC. LDI Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC. DEC Subtract 1 from the contents of the register (ACC or . CMP Compare the contents of ACC with the contents of . JMP Jump to the given address. JPE Following a compare instruction, jump to if the compare was True. STO Store the contents of ACC at the given address. END Return control to the operating system. The current contents of the main memory are: Address Instruction LDD 200 CMP 201 JPE 106 DEC ACC STO 200 JMP 101 END … Trace the program currently in memory using the following trace table. Instruction address ACC Memory address The instruction in memory address 100 needs to be changed. It needs to use indirect addressing to load the contents of memory address 200. Give the new instruction to replace LDD 200. Each instruction in the assembly language program is encoded in 16 bits (8-bit op code followed by an 8-bit operand). The instruction CMP 201 has the operand 201. Convert the operand 201 into 8-bit binary. State the maximum number of op codes that can be represented using eight bits. The status register contains condition flags. Identify three condition flags that can be set in the status register.
9608_s21_qp_11
THEORY
2021
Paper 1, Variant 1
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 Op code Operand LDD Direct addressing. Load the contents of the location at the given address to ACC. LDI Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC. STO Store the 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 . JMP Jump to the given address. CMP Compare the contents of ACC with the contents of . JPE Following a compare instruction, jump to if the compare was True. END Return control to the operating system. The current contents of the main memory are: Address Instruction LDI 103 CMP 101 JPE 59 ADD 102 STO 102 LDD 100 INC ACC STO 100 JMP 51 ADD 102 STO 102 END … Trace the program currently in memory using the following trace table. Instruction address ACC Memory address The instruction in memory address 50 needs to be changed to use direct addressing to load the contents of the memory location at address 100. Give the new instruction to replace LDI 103. Each instruction in the assembly language program is encoded in 16 bits (8-bit op code followed by an 8-bit operand). The instruction JPE 59 has the operand 59. Convert the operand 59 into 8-bit binary. Convert the denary value 59 into hexadecimal. The assembly language program uses direct and indirect addressing. Identify two other modes of addressing used in an assembly language program.
9608_s21_qp_12
THEORY
2021
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 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. DEC Subtract 1 from the contents of the register (ACC or . JMP Jump to the given address. CMP Compare the contents of ACC with the contents of . JPE Following a compare instruction, jump to if the compare was True. 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 and selected values from the ASCII character set are: Address Instruction ASCII code table (selected codes only) LDR #2 ASCII code Character LDX 180 $ CMP #0 ( JPE 82 ) OUT + DEC IX E JMP 76 F END G … Complete a trace table for the execution of the program. Instruction address IX ACC Memory address Output Identify two modes of addressing that are not used in the assembly language program given. Each instruction in the assembly language program is encoded in 16 bits (8-bit op code followed by an 8-bit operand). The instruction LDX 234 has the operand 234. Convert the operand 234 into 8-bit binary. Convert the denary value 234 into hexadecimal. The contents of memory address 190 represent a two’s complement binary integer. Address Convert the value in memory address 190 into denary. The fetch-execute (FE) cycle is shown in register transfer notation. Complete the FE cycle using register transfer notation. ← PC ← + 1 MDR ← [] ←
9608_s21_qp_13
THEORY
2021
Paper 1, Variant 3
Questions Discovered
304