Processor fundamentals and assembly language – A Level Computer Science (old syllabus, to 2021) (9608)

12 questions · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
9608/11/M/J/20 · Question 6May/June 2020Paper 119 marks
Loading question…
Question text

6
A processor has one general purpose register, the Accumulator (ACC), and an Index Register
(IX).
(a) The table gives three assembly language instructions for loading data into the ACC. It also
identifies the addressing mode used for each instruction.
Instruction
Addressing mode
LDM #193
A
Immediate
LDD 193
B
Direct
LDX 193
C
Indexed
(i)
State the contents of the Accumulator after each of the instructions A, B and C are run.
A …
…
B …
…
C …
…
[3]
(ii)
Name two other addressing modes.
1 …
2 …
[2]
(b) The ACC is a general purpose register. The IX is a special purpose register.
Identify two other special purpose registers used in the fetch-execute cycle and describe
their role in the cycle.
Register 1 …
Role …
…
…
Register 2 …
Role …
…
…
[4]

2
9608/12/M/J/20 · Question 5May/June 2020Paper 1212 marks
Loading question…
Question text

5
(a) 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.
[2]
(b) The assembler translates assembly code into machine code.
The table shows the denary values for three assembler op codes.
Op code
Denary value
LDD
194
ADD
200
STO
205
(i)
Convert the denary value for the op code LDD into 8‑bit binary.
[1]
(ii)
Convert the denary value for the op code STO into hexadecimal.
… [1]
(iii)
State why the denary value for the op code ADD cannot be represented in 8‑bit two’s
complement form. Justify your answer.
…
…
…
… [2]
(c) 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 (IX).
Instruction
Explanation
Op code
Operand
LDM
#n
Immediate addressing. Load the denary number n to ACC
Direct addressing. Load the contents of the location at the given address to
LDD
<address>
ACC
Indexed addressing. Form the address from <address> + the contents of the
LDX
<address>
Index Register. Copy the contents of this calculated address to ACC
LDR
#n
Immediate addressing. Load the denary number n to IX
STO
<address>
Store contents of ACC at the given address
ADD
<address>
Add the contents of the given address to ACC
INC
<register>
Add 1 to the contents of the register (ACC or IX)
CMP
<address>
Compare contents of the address given with the contents of ACC
JPE
<address>
Following a compare instruction, jump to <address> if the compare was True
JPN
<address>
Following a compare instruction, jump to <address> if the compare was False
JMP
<address>
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
Complete the trace table for the following assembly language program. The first instruction
has been completed for you.
Address
Instruction
Memory address
Instruction
ACC
20
LDD 103
address
100
101
102
103
21
CMP 101
1
2
3
0
22
JPE 30
23
LDD 100
20
0
24
ADD 101
25
STO 100
26
LDD 103
27
INC ACC
28
STO 103
29
JMP 20
30
END
…
100
1
101
2
102
3
103
0
[6]

3
9608/11/M/J/19 · Question 5May/June 2019Paper 1112 marks
Loading question…
Question text

5
A simple program written in assembly language is translated using a two-pass assembler.
(a) 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
[2]
(b) 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.
1 …
…
2 …
…
[2]
(c) The table shows assembly language instructions for a processor which has one general
purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Op code
Operand
Immediate addressing. Load the denary number n to ACC.
LDM #n
Direct addressing. Load the contents of the location at the given address to
LDD <address>
ACC.
Indexed addressing. Form the address from <address> + the contents of the
LDX <address>
Index Register. Copy the contents of this calculated address to ACC.
Immediate addressing. Load the denary number n to IX.
LDR #n
Store contents of ACC at the given address.
STO <address>
Add the contents of the given address to ACC.
ADD <address>
INC <register> Add 1 to the contents of the register (ACC or IX).
Compare contents of ACC with denary number n.
CMP #n
Following a compare instruction, jump to <address> if the compare was True.
JPE <address>
Following a compare instruction, jump to <address> if the compare was False.
JPN <address>
Jump to the given address.
JMP <address>
Output to screen the character whose ASCII value is stored in ACC.
OUT
Return control to the operating system.
END
The current contents of the main memory, Index Register (IX) and selected values from the
ASCII character set are:
Address
Instruction
ASCII code table (Selected codes only)
20
LDM #0
ASCII Code
Character
21
STO 300
65
A
22
CMP #0
66
B
23
JPE 28
24
LDX 100
67
C
25
ADD 301
68
D
26
OUT
69
E
27
JMP 30
28
LDX 100
97
a
29
OUT
98
b
30
LDD 300
99
c
31
INC ACC
32
STO 300
100
d
33
INC IX
101
e
34
CMP #2
35
JPN 22
36
END
…
100
65
101
67
102
69
103
69
104
68
…
300
301
33
IX
0
Trace the program currently in memory using the following trace table. The first instruction
has been completed for you.
Memory address
Instruction
ACC
IX
OUTPUT
address
100
101
102
103
104
300
301
65
67
69
69
68
33
0
20
0
[8]

Advertisement
4
9608/12/M/J/19 · Question 3May/June 2019Paper 1216 marks
Loading question…
Question text

3
The fetch-execute cycle is shown in register transfer notation.
[PC]
01
MAR
[PC] - 1
02
PC
[MAR]
03
MDR
[MAR]
04
CIR
(a) 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 …
[3]
(b) 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.
1 …
…
2 …
…
[2]
(c) The following table shows assembly language instructions for a processor which has one
general purpose register, the Accumulator (ACC), and an Index Register (IX).
Instruction
Explanation
Op code
Operand
Immediate addressing. Load the denary number n to ACC
LDM #n
Direct addressing. Load the contents of the location at the given address to
LDD <address>
ACC
Indexed addressing. Form the address from <address> + the contents of the
LDX <address>
Index Register. Copy the contents of this calculated address to ACC
Immediate addressing. Load the denary number n to IX
LDR #n
Store contents of ACC at the given address
STO <address>
Add the contents of the given address to ACC
ADD <address>
INC <register> Add 1 to the contents of the register (ACC or IX)
Compare contents of ACC with denary number n
CMP #n
Following a compare instruction, jump to <address> if the compare was True
JPE <address>
Following a compare instruction, jump to <address> if the compare was False
JPN <address>
Jump to the given address
JMP <address>
Output to the screen the character whose ASCII value is stored in ACC
OUT
Return control to the operating system
END
The current contents of the main memory, Index Register (IX) and selected values from the
ASCII character set are:
Address
Instruction
ASCII code table (Selected codes only)
50
LDM #0
ASCII code
Character
51
STO 401
65
A
52
LDX 300
66
B
53
CMP #0
67
C
54
JPE 62
68
D
55
ADD 400
69
E
56
OUT
57
LDD 401
58
INC ACC
59
STO 401
60
INC IX
61
JMP 52
62
END
…
300
2
301
5
302
0
303
4
…
400
64
401
IX
0
Trace the program currently in memory using the following trace table.
The first instruction has been completed for you.
Memory address
Instruction
ACC
IX
OUTPUT
address
300
301
302
303
400
401
2
5
0
4
64
0
50
0
[8]
(d) The ASCII character code for ‘A’ is 65 in denary.
(i)
Convert the denary ASCII character code for ‘A’ into 8-bit binary.
[1]
(ii)
Convert the denary ASCII character code for ‘A’ into hexadecimal.
…

5
9608/13/M/J/19 · Question 4May/June 2019Paper 1312 marks
Loading question…
Question text

4
A program is written in assembly language.
(a) The op codes LDM and LDD are used to load a register. The op code LDM uses immediate
addressing, and the op code LDD uses direct addressing.
Describe what happens when the following instructions are run.
LDM #300
…
…
LDD 300
…
…
[2]
(b) Assembly language instructions can be grouped by their purpose.
The following table shows four assembly language instructions.
Tick (✓) one box in each row to indicate the group each instruction belongs to.
Jump
Arithmetic
Data
Instruction
Description
instruction
operation
movement
LDR #3
Load the number 3 to the
Index Register
ADD #2
Add 2 to the Accumulator
JPN 22
Move to the instruction at
address 22
DEC ACC
Subtract 1 from the
Accumulator
[3]
(c) The processor handles interrupts within the fetch-execute cycle.
(i)
Give one example of a hardware interrupt and one example of a software interrupt.
Hardware …
…
Software …
…
[2]
(ii)
Explain how the processor handles an interrupt.
…
…
…
…
…
…
…
…
…
… [5]

6
9608/11/M/J/18 · Question 8May/June 2018Paper 119 marks
Loading question…
Question text

8
The Von Neumann model uses a series of registers.
(a) Explain what is meant by the term register.
…
…
…
… [2]
(b) (i)
Explain the purpose of the Memory Data Register (MDR).
…
…
…
… [2]
(ii)
Name two registers, other than the MDR, that are used in the fetch-execute cycle.
Register 1 …
Register 2 …
[2]
(c) X is a register. The current contents of X are:
1
0
0
0
0
1
1
1
(i)
The current contents of register X represent an unsigned binary integer.
Convert the value in X into denary.
… [1]
(ii)
The current contents of register X represent a Binary Coded Decimal.
Convert the value in X into denary.
… [1]
(iii)
The current contents of register X stores a two’s complement binary integer.
Convert the value in X into denary.
… [1]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local

7
9608/13/M/J/18 · Question 3May/June 2018Paper 1312 marks
Loading question…
Question text

3
A computer is designed using the Von Neumann model.
(a) Describe the role of the Arithmetic and Logic Unit (ALU) and Control Unit (CU) in the Von
Neumann model.
ALU …
…
…
…
CU …
…
…
…
[4]
(b) Describe the role of the Status Register and Program Counter (PC).
Status Register …
…
…
…
PC …
…
…
…
[4]
(c) H is a register. The current contents of H are:
1
1
0
0
0
0
0
1
The current contents of register H represent an unsigned binary integer.
(i)
Convert the value in register H into denary.
… [1]
(ii)
Convert the value in register H into hexadecimal.
… [1]
(iii)
The current contents of register H represent a two’s complement binary integer.
Convert the value in register H into denary.
… [1]
(iv)
State why register H does not currently contain a Binary Coded Decimal (BCD).
…
… [1]

8
9608/11/M/J/17 · Question 4May/June 2017Paper 1112 marks
Loading question…
Question text

4
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 (IX).
Instruction
Explanation
Op code
Op code
Operand
(mnemonic)
(binary)
Immediate addressing. Load the denary number n to
0000 0001
LDM
#n
ACC.
Direct addressing. Load the contents of the location
0000 0010
LDD
<address>
at the given address to ACC.
Indirect addressing. At the given address is the
0000 0101
address to be used. Load the contents of this second
LDI
<address>
address to ACC.
Indexed addressing. Form the address from
<address> + the contents of the Index Register
0000 0110
LDX
<address>
(IX). Copy the contents of this calculated address to
ACC.
0000 0111
Immediate addressing. Load number n to IX.
LDR
#n
0000 1111
Store the contents of ACC at the given address.
STO
<address>
The following diagram shows the contents of a section of main memory and the Index Register (IX).
(a) Show the contents of the Accumulator (ACC) after each instruction is executed.
IX
0
0
0
0
0
0
1
1
Main
(i)
LDM #500
Memory
Address
contents
ACC
… [1]
13
495
(ii)
LDD 500
86
496
ACC
… [1]
92
497
486
498
(iii)
LDX 500
489
499
ACC
… [1]
496
500
(iv)
LDI 500
497
501
499
502
ACC
… [1]
502
503
(b) 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
[3]
(c) Using an 8-bit operand, state the maximum number of memory locations, in denary, that can
be directly addressed.
… [1]
(d) Computer scientists often write binary representations in hexadecimal.
(i)
Write the hexadecimal representation for this instruction:
0
0
0
0
0
1
1
1
1
1
0
0
0
0
1
0
… [2]
(ii)
A second instruction has been written in hexadecimal as:
05 3F
Write the equivalent assembly language instruction, with the operand in denary.
… [2]

Advertisement
9
9608/12/M/J/17 · Question 5May/June 2017Paper 1211 marks
Loading question…
Question text

5
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 (IX).
Instruction
Explanation
Op code
Op code
Operand
(mnemonic)
(binary)
Direct addressing. Load the contents of
the location at the given address to the
LDD
<address>
0001 0011
Accumulator (ACC).
Indirect addressing. The address to be used is
at the given address. Load the contents of this
LDI
<address>
0001 0100
second address to ACC.
Indexed addressing. Form the address from
<address> + the contents of the Index
LDX
<address>
0001 0101
Register. Copy the contents of this calculated
address to ACC.
Immediate addressing. Load the denary
LDM
#n
0001 0010
number n to ACC.
Immediate addressing. Load denary number n
LDR
#n
0001 0110
to the Index Register (IX).
Store the contents of ACC at the given
STO
<address>
0000 0111
address.
The following diagram shows the contents of a section of main memory and the Index Register (IX).
(a) Show the contents of the Accumulator (ACC) after each instruction is executed.
IX
0
0
0
0
0
1
1
0
(i)
LDD 355
Main
ACC
… [1]
memory
Address
contents
(ii)
LDM #355
350
ACC
… [1]
351
86
352
(iii)
LDX 351
353
ACC
… [1]
354
(iv)
LDI 355
355
351
356
ACC
… [1]
357
22
358
(b) 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
[3]
(c) Computer scientists often write binary representations in hexadecimal.
(i)
Write the hexadecimal representation for the following instruction.
0
0
0
1
0
1
0
0
0
1
0
1
1
1
1
0
… [2]
(ii)
A second instruction has been written in hexadecimal as:
16 4D
Write the assembly language for this instruction with the operand in denary.
… [2]

10
9608/11/M/J/16 · Question 3May/June 2016Paper 118 marks
Loading question…
Question text

3
(a) Describe how special purpose registers are used in the fetch stage of the fetch-execute cycle.
…
…
…
…
…
…
…
… [4]
(b) Use the statements A, B, C and D to complete the description of how the fetch-execute cycle
handles an interrupt.
the address of the Interrupt Service Routine (ISR) is loaded to the Program
A
Counter (PC).
B
the processor checks if there is an interrupt.
C
when the ISR completes, the processor restores the register contents.
D
the register contents are saved.
At the end of the cycle for the current instruction … .
If the interrupt flag is set, … , … and … .
The interrupted program continues its execution.
[4]

11
9608/11/M/J/16 · Question 9May/June 2016Paper 1110 marks
Loading question…
Question text

9
The table shows assembly language instructions for a processor which has one general purpose
register, the Accumulator (ACC) and an index register (IX).
Instruction
Explanation
Op code
Operand
LDD
<address>
Direct addressing. Load the contents of the given address to ACC.
Indexed addressing. Form the address from <address> + the contents of the
LDX
<address>
index register. Copy the contents of this calculated address to ACC.
STO
<address>
Store contents of ACC at the given address.
ADD
<address>
Add the contents of the given address to ACC.
INC
<register>
Add 1 to the contents of the register (ACC or IX).
DEC
<register>
Subtract 1 from the contents of the register (ACC or IX).
CMP
<address>
Compare contents of ACC with contents of <address>.
JPE
<address>
Following a compare instruction, jump to <address> if the compare was True.
Following a compare instruction, jump to <address> if the compare was
JPN
<address>
False.
JMP
<address>
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.
(a) The diagram shows the current contents of a section of main memory and the index register:
60
0011
0010
61
0101
1101
62
0000
0100
63
1111
1001
64
0101
0101
65
1101
1111
66
0000
1101
67
0100
1101
68
0100
0101
69
0100
0011
...
0110 1001
1000
Index register: 0 0 0 0 1 0 0 0
(i)
Show the contents of the Accumulator after the execution of the instruction:
LDX 60
Accumulator:
Show how you obtained your answer.
…
…
…
… [2]
(ii)
Show the contents of the index register after the execution of the instruction:
DEC IX
Index register:
[1]
(b) Complete the trace table on the opposite page for the following assembly language program.
50 LDD 100
51 ADD 102
52 STO 103
53 LDX 100
54 ADD 100
55 CMP 101
56 JPE 58
57 JPN 59
58 OUT
59 INC IX
60 LDX 98
61 ADD 101
62 OUT
63 END
...
20
100
100
101
1
102
0
103
1
IX (Index Register)
Selected values from the ASCII character set:
ASCII Code
118
119
120
121
122
123
124
125
Character
v
w
x
y
z
{
|
}
Trace table:
Memory address
Instruction
Working
ACC
IX
OUTPUT
address
space
100
101
102
103
20
100
1
0
1
50
51
52
53
54
55
[7]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable
be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local

12
9608/13/M/J/16 · Question 4May/June 2016Paper 138 marks
Loading question…
Question text

4
The table shows assembly language instructions for a processor which has one general purpose
register, the Accumulator (ACC) and an index register (IX).
Instruction
Explanation
Op code
Operand
LDD
<address>
Direct addressing. Load the contents of the given address to ACC.
Indexed addressing. Form the address from <address> + the contents of the
LDX
<address>
index register. Copy the contents of this calculated address to ACC.
STO
<address>
Store contents of ACC at the given address.
ADD
<address>
Add the contents of the given address to ACC.
INC
<register>
Add 1 to the contents of the register (ACC or IX).
DEC
<register>
Subtract 1 from the contents of the register (ACC or IX).
CMP
<address>
Compare contents of ACC with contents of <address>.
JPE
<address>
Following a compare instruction, jump to <address> if the compare was True.
JPN
<address>
Following a compare instruction, jump to <address> if the compare was False.
JMP
<address>
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 contents of the index register:
1
1
0
0
1
1
0
1
Index register:
(a) Show the contents of the index register after the execution of the instruction:
INC IX
Index register:
[1]
(b) Complete the trace table on the opposite page for the following assembly language program.
20 LDX 90
21 DEC ACC
22 STO 90
23 INC IX
24 LDX 90
25 DEC ACC
26 CMP 90
27 JPE 29
28 JPN 31
29 ADD 90
30 OUT
31 ADD 93
32 STO 93
33 OUT
34 END
:
:
90 2
91 90
92 55
93 34
IX 2
Selected values from the ASCII character set:
ASCII Code
65
66
67
68
69
70
71
72
Character
A
B
C
D
E
F
G
H
Trace table:
Memory address
Working
ACC
IX
OUTPUT
Instruction
space
90
91
92
93
2
90
55
34
2
20
21
22
23
24
25
26
[7]

Advertisement