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

32 questions · page 3 of 3 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
31
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

32
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