9608/13/M/J/15 © Ucles 2015
9608/13/M/J/15 © Ucles 2015
9608/13/M/J/15 © Ucles 2015
14
7 The table shows assembly language instructions for a processor which has one general purpose
register, the Accumulator (ACC).
Instruction
Explanation
Op code Operand
Main memory
(a) (i) Show the contents of the Accumulator after execution of the instruction:
LDD 121
Accumulator:
[1]
(ii) Show the contents of the Accumulator after execution of the instruction:
LDI 124
Accumulator:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [3]
(iii) Show the contents of the Accumulator after execution of the instruction:
LDX 120
Index Register: 0 0 0 0 0 1 1 0
Accumulator:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [3]
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.
LDX <address> Indexed addressing. Form the address from <address> + the contents of the
index register. Copy the contents of this calculated address to ACC.
STO <address> Store contents of ACC at the given address.
DEC <register> Subtract 1 from the contents of the register (ACC or IX).
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.
(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
...
1000 0110 1001
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:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[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
...
100 20
101 100
102 1
103 0
IX (Index Register) 1
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]
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.
DEC <register> Subtract 1 from the contents of the register (ACC or IX).
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.
OUT Output to screen the character whose ASCII value is stored in ACC.
Index register: 1 1 0 0 1 1 0 1
(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
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]
8 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
LDX <address> contents of the 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.
CMP <address> Compare contents of ACC with contents of <address>
Following a compare instruction, jump to <address> if the compare
JPE <address>
was True.
Following a compare instruction, jump to <address> if the compare
JPN <address>
was False.
JMP <address> Jump to the given address.
Output to the screen the character whose ASCII value is stored in
OUT
ACC.
END Return control to the operating system.
Main memory
800 0110 0100
801 0111 1100
802 1001 0111
803 0111 0011
804 1001 0000
805 0011 1111
806 0000 1110
807 1110 1000
808 1000 1110
809 1100 0010
:
:
2000 1011 0101
(a) (i) Show the contents of the Accumulator after execution of the instruction:
LDD 802
Accumulator:
[1]
(ii) Show the contents of the Accumulator after execution of the instruction:
LDX 800
Index Register: 0 0 0 0 1 0 0 1
Accumulator:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(b) (i) Complete the trace table below for the following assembly language program. This
program contains denary values.
Trace table:
Memory address
ACC OUTPUT
800 801 802 803
40 50 0 90
[4]
.......................................................................................................................................[1]
(c) The program used the ASCII coding system for character codes. An alternative coding system
is Unicode.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
.......................................................................................................................................[2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
BLANK PAGE
BLANK PAGE
5 The table shows assembly language instructions for a processor that has one general purpose
register, the Accumulator (ACC) and an index register (IX).
Instruction
Explanation
Op Code Operand
Direct addressing. Load the contents of the given address to
LDD <address>
ACC.
Index addressing. Form the address from <address> +
LDX <address> the contents of the index register. Copy the contents of this
calculated address to ACC.
Indirect addressing. The address to be used is at the given
LDI <address>
address. Load the contents of this second address to ACC.
ADD <address> Add the contents of the given address to the ACC.
Main memory
(a) (i) Show the contents of the Accumulator after the execution of the instruction:
LDD 102
ACC:
[1]
(ii) Show the contents of the Accumulator after the execution of the instruction:
LDX 101
IX: 0 0 0 0 0 1 0 0
ACC:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[2]
(iii) Show the contents of the Accumulator after the execution of the instruction:
LDI 103
ACC:
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(b) Complete the trace table below for the following assembly language program.
806 END
810 28
811 41
812 0
813 0
Trace table:
Memory address
ACC
810 811 812 813
28 41 0 0
[6]
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
Op code Op code Explanation
Operand
(mnemonic) (binary)
Immediate addressing. Load the denary number n to
LDM #n 0000 0001
ACC.
Direct addressing. Load the contents of the location
LDD <address> 0000 0010
at the given address to ACC.
Indirect addressing. At the given address is the
LDI <address> 0000 0101 address to be used. Load the contents of this second
address to ACC.
Indexed addressing. Form the address from
<address> + the contents of the Index Register
LDX <address> 0000 0110
(IX). Copy the contents of this calculated address to
ACC.
LDR #n 0000 0111 Immediate addressing. Load number n to IX.
STO <address> 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 (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]
495 13
(ii) LDD 500
496 86
ACC ................................................................[1] 497 92
(b) Each machine code instruction is encoded as 16-bits (8-bit op code followed by an 8-bit
operand).
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]
0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 0
.......................................................................................................................................[2]
05 3F
Write the equivalent assembly language instruction, with the operand in denary.
.......................................................................................................................................[2]
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
Op code Op code Explanation
Operand
(mnemonic) (binary)
Direct addressing. Load the contents of
LDD <address> 0001 0011 the location at the given address to the
Accumulator (ACC).
Indirect addressing. The address to be used is
LDI <address> 0001 0100 at the given address. Load the contents of this
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
(b) Each machine code instruction is encoded as 16 bits (8-bit op code followed by an 8-bit
operand).
LDM #67
LDX #7
[3]
0 0 0 1 0 1 0 0 0 1 0 1 1 1 1 0
.......................................................................................................................................[2]
16 4D
Write the assembly language for this instruction with the operand in denary.
.......................................................................................................................................[2]
4 (a) The diagram shows the components and buses found inside a typical Personal Computer
(PC).
General purpose
registers
D
Arithmetic Logic
E F
Unit (ALU)
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 ...........................................................................................................................................
[5]
(b) 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
Op code Op code Explanation
Operand
(mnemonic) (binary)
LDM #n 1100 0001 Immediate addressing. Load number n to ACC.
Direct addressing. Load the contents of the given
LDD <address> 1100 0010
address to ACC.
Relative addressing. Move to the address n locations
LDV #n 1100 0011 from the address of the current instruction. Load the
contents of this address to ACC.
STO <address> 1100 0100 Store the contents of ACC at the given address.
DEC 1100 0101 Decrement the contents of ACC.
Output the character corresponding to the ASCII
OUTCH 1100 0111
character code in ACC.
Following a compare instruction, jump to <address> if
JNE <address> 1110 0110
the compare was False.
JMP <address> 1110 0011 (Unconditionally) jump to the given address.
CMP #n 1110 0100 Compare the contents of ACC with number n.
Complete the trace table for the following assembly language program.
Label Instruction
StartProg: LDV #CountDown
CMP Num1
ASCII code table (selected codes only)
JNE CarryOn
<Space> 3 B C X
JMP Finish
32 51 66 67 88
CarryOn: OUTCH
LDD CountDown
DEC
STO CountDown
JMP StartProg
Finish: LDM #88
OUTCH
END
CountDown: 15
32
51
67
Num1: 32
Trace table:
[5]
(c) The program given in part (b) 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: 15
32
51
67
Num1: 32
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
StartProg 1 100 2
CountDown 3 UNKNOWN 4
Num1 5 UNKNOWN 6
Finish 9 UNKNOWN 10
Explain how the assembler made these entries to the symbol table.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
(d) The assembler software must then complete the second pass building up the executable file.
(i) Name the second table needed when the assembler software carries out the second
pass.
.......................................................................................................................................[1]
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.
(ii) Use the following instruction set to write the numbers for A and B.
A (binary) ........................................................................................................................
B (hexadecimal) .............................................................................................................
[3]
Instruction
Op code Op code Explanation
Operand
(mnemonic) (binary)
LDM #n 1100 0001 Immediate addressing. Load number n to ACC.
Direct addressing. Load the contents of the given
LDD <address> 1100 0010
address to ACC.
Relative addressing. Move to the address n locations
LDV #n 1100 0011 from the address of the current instruction. Load the
contents of this address to ACC.
STO <address> 1100 0100 Store the contents of ACC at the given address.
DEC 1100 0101 Decrement the contents of ACC.
Output the character corresponding to the ASCII
OUTCH 1100 0111
character code in ACC.
Following a compare instruction, jump to <address> if
JNE <address> 1110 0110
the compare was False.
JMP <address> 1110 0011 (Unconditionally) jump to the given address.
CMP #n 1110 0100 Compare the contents of ACC with number n.
4 The following diagram shows the components and buses found inside a typical personal computer
(PC).
C D
E
Control unit
Main memory
(a) 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 ...........................................................................................................................................
[5]
(b) Clock speed is a factor that affects the performance of a PC. Explain this statement.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) An assembly language program can contain both macros and directives.
Macro ................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Directive ............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
...........................................................................................................................................
.......................................................................................................................................[1]
(d) 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
Op code Explanation
Operand
(mnemonic)
Direct addressing. Load the contents of the given address
LDD <address>
to ACC.
Relative addressing. Move to the address n locations from
LDV #n the address of the current instruction. Load the contents of
this address to ACC.
STO <address> Store the contents of ACC at the given address.
INC Increment the contents of ACC.
Output the character corresponding to the ASCII character
OUTCH
code in ACC.
Following a compare instruction, jump to <address> if the
JPE <address>
compare was True.
JMP <address> Jump to the given address.
CMP #n Compare the contents of ACC with number n.
Complete the trace table for the following assembly language program.
Label Instruction
StartProg: LDV #Offset
CMP Value
ASCII code table (selected codes only)
JPE EndProg
<Space> 2 A B Y
OUTCH
32 50 65 66 89
LDD Offset
INC
STO Offset
JMP StartProg
EndProg: END
Offset: 10
50
65
89
32
Value: 32
Trace table:
[5]
(e) The program given in part (d) 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: 10
50
65
89
32
Value: 32
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
StartProg 1 0 2
Offset 3 UNKNOWN 4
Value 5
[6]
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
Direct addressing. Load the contents of the location at the given
LDD <address>
address to ACC.
Indexed addressing. Form the address from <address> + the
LDX <address> contents of the Index Register. Copy the contents of this calculated
address to ACC.
LDR #n Immediate addressing. Load the 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).
DEC <register> Subtract 1 from the contents of the register (ACC or IX).
CMP <address> Compare contents of ACC with contents of <address>.
Following a compare instruction, jump to <address> if the compare
JPE <address>
was True.
Following a compare instruction, jump to <address> if the compare
JPN <address>
was False.
JMP <address> 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.
(a) (i) State what is meant by direct addressing and indirect addressing.
...........................................................................................................................................
...........................................................................................................................................
[2]
(ii) Explain how the instruction ADD 20 can be interpreted as either direct or indirect
addressing.
...........................................................................................................................................
...........................................................................................................................................
[2]
(b) The assembly language instructions in the following table use either symbolic addressing or
absolute addressing.
Tick (3) one box in each row to indicate whether the instruction uses symbolic or absolute
addressing.
ADD 90
CMP found
STO 20
[2]
X 1 0 1 1 1 0 1 0
.......................................................................................................................................[1]
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(d) The current contents of the main memory, Index Register (IX) and selected values from the
ASCII character set are provided with a copy of the instruction set.
Complete the trace table for the given assembly language program.
[8]
3 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
LDD <address> Direct addressing. Load the contents of the location at the given address to
ACC.
LDX <address> Indexed addressing. Form the address from <address> + 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.
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 compare instruction, jump to <address> if the compare was True.
JPN <address> Following compare instruction, jump to <address> if the compare was False.
JMP <address> 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.
(a) (i) State what is meant by absolute addressing and symbolic addressing.
...........................................................................................................................................
...........................................................................................................................................
[2]
(ii) Give an example of an ADD instruction using both absolute addressing and symbolic
addressing.
(b) (i) State what is meant by indexed addressing and immediate addressing.
...........................................................................................................................................
...........................................................................................................................................
[2]
X 1 1 0 0 0 0 0 1
...................................................................................................................................... [1]
...................................................................................................................................... [1]
...................................................................................................................................... [1]
(d) The current contents of the main memory, Index Register (IX) and selected values from the
ASCII character set are:
100 2
101 302
102 303
103 303
104 0
105 303
IX 1
Instruction
Explanation
Op code Operand
LDD <address> Direct addressing. Load the contents of the location at the given address to
ACC.
LDX <address> Indexed addressing. Form the address from <address> + 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.
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 the screen the character whose ASCII value is stored in ACC.
END Return control to the operating system.
Complete the trace table for the given assembly language program.
[7]
2 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
Direct addressing. Load the contents of the location at the given address
LDD <address>
to ACC.
Indexed addressing. Form the address from <address> + the contents of
LDX <address>
the Index Register. Copy the contents of this calculated address to ACC.
LDR #n Immediate addressing. Load the 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).
DEC <register> Subtract 1 from the contents of the register (ACC or IX).
CMP <address> Compare contents of ACC with contents of <address>.
Following compare instruction, jump to <address> if the compare was
JPE <address>
True.
Following compare instruction, jump to <address> if the compare was
JPN <address>
False.
JMP <address> 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.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[2]
X 1 1 1 1 0 0 1 0
.......................................................................................................................................[1]
.......................................................................................................................................[1]
.......................................................................................................................................[1]
(iv) Show the result on the general purpose register (X) after the following instruction is run.
INC X
[1]
(c) The current contents of the main memory, Index Register (IX) and selected values from the
ASCII character set are provided with a copy of the instruction set.
Complete the trace table for the given assembly language program.
[7]
(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.
(b) The processor’s instruction set can be grouped according to their function. For example, one
group is modes of addressing.
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
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 #n Compare contents of ACC with denary number n.
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 current contents of the main memory, Index Register (IX) and selected values from the
ASCII character set are:
IX 0
© UCLES 2019 9608/11/M/J/19
11
Trace the program currently in memory using the following trace table. The first instruction
has been completed for you.
65 67 69 69 68 33 0
20 0
[8]
01 MAR [PC]
02 PC [PC] - 1
03 MDR [MAR]
04 CIR [MAR]
Identify the line number of each error and give the correction.
Correction .................................................................................................................................
Correction .................................................................................................................................
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.
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
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 #n Compare contents of ACC with denary number n
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 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 (IX) and selected values from the
ASCII character set are:
IX 0
© UCLES 2019 9608/12/M/J/19
7
Trace the program currently in memory using the following trace table.
The first instruction has been completed for you.
2 5 0 4 64 0
50 0
[8]
(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.
..................................................................................................................................... [1]
..................................................................................................................................... [1]
(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.
LDM #300
...................................................................................................................................................
...................................................................................................................................................
LDD 300
...................................................................................................................................................
...................................................................................................................................................
[2]
Tick (✓) one box in each row to indicate the group each instruction belongs to.
(i) Give one example of a hardware interrupt and one example of a software interrupt.
Hardware ...........................................................................................................................
...........................................................................................................................................
Software ............................................................................................................................
...........................................................................................................................................
[2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [5]