Chapter 6 Assembly Language-PPandMS-15
Chapter 6 Assembly Language-PPandMS-15
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]
(b) Trace the assembly language program using the trace table.
320 49
321 36
322 0
323 0
Trace table:
Memory address
Accumulator
320 321 322 323
49 36 0 0
[6]
7 (a) (i)
Accumulator: 0 1 1 1 0 1 0 1
[1]
(ii)
Accumulator: 0 1 1 0 1 0 0 1
[1]
explanation
• content of 124 is 0 1 1 1 1 1 1 1
• this is equivalent to 127
• contents of 127 are 0 1 1 0 1 0 0 1 [2]
(iii)
Accumulator: 0 1 0 0 0 0 0 1
[1]
explanation
49 36 0 0
36
37
37
49
50
50
[6]