Computer Systems Architecture Test – Monday 5 November 2007
1. What is the value of ?
2. What is the value of []?
3. What is the value of [[]]?
4. What is the value of [ +  + 3]?
Consider the following assembler directives used in Q5 to Q7.
ORG $1000 Note: the left-hand column is a label that refers to the ADDRESS of that line. For example,
X DC.B 2 the value of Z is $1002.
Y DC.B 4
P DC.B Q is equivalent to the C code int p = q
Z DC.B 1
It defines a variable and initializes it.
A DS.B 1
B DS.B 2 T DS.B n defines the first address as ‘P’ and then reserves n bytes in memory.
C DS.W 1
D DS.B 1 .B defines a byte, .W two bytes and .L four bytes
5. What is the value of X (i.e., what number replaces X in a program)?
6. What number is stored in memory location 1002?
7. What is the value of D (in hexadecimal)?
Using the same memory map as question 1, answer the following questions 8 to 14. Note assume that the operations follow
on from each other. In each case give the value (number) loaded into the destination register.
8. What is the effect of MOVE.L 4,A0?
9. What is the effect of MOVE.L (A0),D0?
10. What is the effect of ADD.L #1,A0?
11. What is the effect of MOVE.L (A0),D0?
12. What is MOVE.B #4,D1?
13. What is MOVE.B 4,D2?
14. What is MOVE.B (4),D3? NOTE – this format is not actually provided by the 68K – just assume it is!
15. What is the RTL definition of ADD.B #1,(A2)
16. In 68K assembly language what is the difference between the two symbols # and $
16. Why is the following code incorrect? What is the problem and how is it fixed?
You are required to do this tutorial sheet in your own time and hand it into me either on 19 November (Monday groups) or 23
November (Thursday group).