1.4. Processor fundamentals
A subsection of Computer Science, 9608, through 1. Theory Fundamentals
Listing 10 of 63 questions
The following diagram shows the components and buses found inside a typical personal computer (PC). A B C Control unit Main memory F E D Some components and buses only have labels A to F to identify them. For each label, choose the appropriate title from the following list. The title for label D is already given. • Control bus • Address bus • Arithmetic Logic Unit (ALU) • General purpose registers • Secondary storage • System clock A B C D Data bus E F Clock speed is a factor that affects the performance of a PC. Explain this statement. An assembly language program can contain both macros and directives. Explain what is meant by these terms. Macro Directive Give an example of the use of a directive. 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 LDD Direct addressing. Load the contents of the given address to ACC. LDV #n Relative addressing. Move to the address n locations from the address of the current instruction. Load the contents of this address to ACC. STO Store the contents of ACC at the given address. INC Increment the contents of ACC. OUTCH Output the character corresponding to the ASCII character code in ACC. JPE Following a compare instruction, jump to if the compare was True. JMP Jump to the given address. CMP #n Compare the contents of ACC with number n. The program given in part is to be translated using a two-pass assembler. The program has been copied here for you. Label Instruction StartProg: LDV #Offset CMP Value JPE EndProg OUTCH LDD Offset INC STO Offset JMP StartProg EndProg: END Offset: Value: On the first pass, the assembly process adds entries to a symbol table. The following symbol table shows the first five entries, part way through the first pass. The circular labels show the order in which the assembler made the entries to the symbol table. Complete the symbol table. Use circular labels to show the order in which the assembler makes the entries. Symbol table Symbolic address Relative address StartProg Offset UNKNOWN Value
9608_w17_qp_12
THEORY
2017
Paper 1, Variant 2
The diagram shows the components and buses found inside a typical Personal Computer (PC). General purpose registers A B C Arithmetic Logic Unit (ALU) F E D Some components and buses only have labels A to F to identify them. For each label, choose the appropriate title from the following list. The title for label D is already given. • Control bus • System clock • Data bus • Control unit • Main memory • Secondary storage A B C D Address bus E F 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 1100 0001 Immediate addressing. Load number n to ACC. LDD 1100 0010 Direct addressing. Load the contents of the given address to ACC. LDV #n 1100 0011 Relative addressing. Move to the address n locations from the address of the current instruction. Load the contents of this address to ACC. STO 1100 0100 Store the contents of ACC at the given address. DEC 1100 0101 Decrement the contents of ACC. OUTCH 1100 0111 Output the character corresponding to the ASCII character code in ACC. JNE 1110 0110 Following a compare instruction, jump to if the compare was False. JMP 1110 0011 (Unconditionally) jump to the given address. CMP #n 1110 0100 Compare the contents of ACC with number n. The program given in part is to be translated using a two-pass assembler. The program has been copied here for you. The program now starts with a directive which tells the assembler to load the first instruction of the program to address 100. Label ORG #0100 StartProg: LDV #CountDown CMP Num1 JNE CarryOn JMP Finish CarryOn: OUTCH LDD CountDown DEC STO CountDown JMP StartProg Finish: LDM #88 OUTCH END CountDown: Num1: On the first pass of the two-pass process, the assembler adds entries to a symbol table. The following symbol table shows the first eleven entries, part way through the first pass. The circular labels show the order in which the assembler made the entries to the symbol table. Symbol table Symbolic address Absolute address StartProg CountDown UNKNOWN Num1 UNKNOWN CarryOn UNKNOWN 104 11 Finish UNKNOWN Explain how the assembler made these entries to the symbol table. The assembler software must then complete the second pass building up the executable file. Name the second table needed when the assembler software carries out the second pass. The following shows two of the program instructions in machine code. Machine code Instruction Binary Hexadecimal OUTCH 1100 0111 C7 JNE CarryOn A B Each of the numbers A and B represents the complete instruction in two bytes, one byte for the op code and one byte for the operand. Use the following instruction set to write the numbers for A and B. A B Instruction Explanation Op code Operand Op code LDM #n 1100 0001 Immediate addressing. Load number n to ACC. LDD 1100 0010 Direct addressing. Load the contents of the given address to ACC. LDV #n 1100 0011 Relative addressing. Move to the address n locations from the address of the current instruction. Load the contents of this address to ACC. STO 1100 0100 Store the contents of ACC at the given address. DEC 1100 0101 Decrement the contents of ACC. OUTCH 1100 0111 Output the character corresponding to the ASCII character code in ACC. JNE 1110 0110 Following a compare instruction, jump to if the compare was False. JMP 1110 0011 (Unconditionally) jump to the given address. CMP #n 1110 0100 Compare the contents of ACC with number n.
9608_w17_qp_13
THEORY
2017
Paper 1, Variant 3
A simple program written in assembly language is translated using a two-pass assembler. The table contains some of the tasks performed by a two-pass assembler. Tick (✓) one box in each row to indicate whether the task is performed at the first or second pass. The first row has been completed for you. Task First pass Second pass Creation of symbol table ✓ Expansion of macros Generation of object code Removal of comments The processor’s instruction set can be grouped according to their function. For example, one group is modes of addressing. Identify two other groups of instructions. 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 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 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 300 CMP #0 JPE 28 LDX 100 ADD 301 OUT JMP 30 LDX 100 OUT LDD 300 INC ACC STO 300 INC IX CMP #2 JPN 22 END … … IX ASCII code table (Selected codes only) ASCII Code Character A B C D E a b c d e
9608_s19_qp_11
THEORY
2019
Paper 1, Variant 1
The steps 1 to 6 describe the first pass of a two‑pass assembler. The following three statements are used to complete the sequence of steps. A If it is already in the symbol table, it checks to see if the absolute address is known B When it meets a symbolic address, it checks to see if it is already in the symbol table C If it is known, it is entered Write one of the letters A, B or C in the appropriate step to complete the sequence. 1. The assembler reads the assembly language instructions 2. 3. If it is not, it adds it to the symbol table 4. 5. 6. If it is not known, it is marked as unknown. The assembler translates assembly code into machine code. The table shows the denary values for three assembler op codes. Op code Denary value LDD ADD STO Convert the denary value for the op code LDD into 8‑bit binary. Convert the denary value for the op code STO into hexadecimal. State why the denary value for the op code ADD cannot be represented in 8‑bit two’s complement form. Justify your answer. 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 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 Compare contents of the address given with the contents of ACC 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
9608_s20_qp_12
THEORY
2020
Paper 1, Variant 2
Questions Discovered
63