Homework # 1
Date: October 6, 1998 Due Date: October 18, 1998
Question 1 (3- pp. 114) (35 Points)
LOC |
Source statements |
Object Code |
||
0000 |
SUM |
START |
0 |
|
0000 |
FIRST |
LDX |
#0 |
05000 |
0003 |
LDA |
#0 |
01000 |
|
0006 |
+LDB |
#TABLE2 |
69101790 |
|
BASE |
TABLE2 |
|||
000A |
LOOP |
ADD |
TABLE,X |
1BA013 |
000D |
ADD |
TABLE2,X |
1BC000 |
|
0010 |
TIX |
COUNT |
2F200A |
|
0013 |
JLT |
LOOP |
3B2FF4 |
|
0016 |
+STA |
TOTAL |
0F102F00 |
|
001A |
RSUB |
4F0000 |
||
001D |
COUNT |
RESW |
1 |
|
0020 |
TABLE |
RESW |
2000 |
|
1790 |
TABLE2 |
RESW |
2000 |
|
2F00 |
TOTAL |
RESW |
1 |
|
END |
FIRST |
Question 2 (6- pp. 117): (30 Points)
LINE |
LOC |
Source Statements |
Object Code |
||
45 |
001A |
ENDFIL |
+LDA |
=C'EOF' |
03101073 |
135 |
103E |
RLOOP |
TD |
=X'F1' |
E32035 |
145 |
1044 |
RD |
=X'F1' |
DB202F |
|
215 |
105F |
RLOOP |
TD |
=X'05' |
E32015 |
230 |
1068 |
RD |
=X'05' |
DF200C |
|
1073 |
* |
=C'EOF' |
454F46 |
||
1076 |
* |
=X'F1' |
F1 |
||
1077 |
* |
=X'05' |
05 |
Question 3 (11- pp. 118): (15 Points)
After implementing all the features of Section 3.2 the symbol table (SYMTAB) will consists of the following fields:
Name |
Type |
Block Name |
Address/Value |
Flags |
Where:
Name: is the symbol name.
Type: is either R (Relative) or A (Absolute).
Block Name: is the Block Name in which the symbol is defined (if USE directive is used).
Address/Value: is the address of the symbol, or the value if it is not a label of an address.
Flags: is the flags set by the assembler, such as undefined symbol or external symbol
Question 4 (14- pp. 118): (20 Points)
To include the items of the CDATA block in the default block, we need to remove the USE directives in lines 92, 183
and 252.The generated object program will be:
H^COPY ^000000^001071
T^000000^1E^172063^4B2021^032060^290000^332006^4B203B^3F2FFE^032055^0F2056^01003
T^00001E^09^0F2048^4B2029^3E203F
T^00002D^1D^B410^B400^B440^75101000^E32038^332FFA^DB2032^A004^332008^57A02F^B850
T^00004A^1D^3B2FEA^13201F^4F0000^F1^B410^772017^E3201B^332FFA^53A016^DF2012^B850
T^000067^0A^3B2FEF^4F0000^454F46^05
E^000000