ICS 331: System Software (981)
Quiz # 2
Date: October 6, 1998 Time: 20 minutes
Question 1:
List two of the major functions that are performed by an assembler in pass 2. (3 Points)
1) Replace all mnemonics by op code and all symbols of operands by addresses/displacements.
2) Assemble the instructions and produce the object code and program listing.
Question 2:
Generate the value of LOC and the object code of the following SIC/XE assembly program: (14 Points)
Line |
LOC |
Sources Statements |
Object Code |
||
1 |
1055 |
QUIZZ |
START |
1055 |
|
2 |
1055 |
FIRST |
+LDB |
#4096 |
69101000 |
3 |
1059 |
LDA |
X'454F46' |
032006 |
|
4 |
105C |
STA |
RESULT |
0 F2000 |
|
5 |
105F |
RESULT |
RESW |
1 | |
6 |
END |
QUIZZ | |||
7 |
1062 |
* |
=X'454F46' |
454F46 |
You may need the following information: (Op Code for LDA is 00, for LDB
is 68, and for STA is 0C.
The order of Flags Bits is: n-i-x-b-p-e.)
Question 3:
Briefly describe how does the assembler indicate to the loader that an
assembly program may need some
changes in its object code before loading it into the memory.
(3 Points)
It creates a modification record for every statement that needs to
be changed during loading time,
which are extended format instructions. The change is done by adding the Loading address
of the
program to this address. The record contains the address and the length of the part to be
modified.