Professional Documents
Culture Documents
Sheet 4.2
Sheet 4.2
2)
1- Complete the following statements
a- The ……………. statement in a control section names symbols that are
defined in this control section and may be used by other sections.
b- The ……………. statement names symbols that are used in this control
section and are defined elsewhere.
2- Consider the following two programs (Fig. 1.a) and complete their
corresponding object programs (Fig. 1.b).
Location Source statement Object
code
0000 PROGA START 0
EXTDEF LISTA,ENDA
EXTREF LISTC
.
.
.
0020 REF1 LDA LISTA 03201D
.
.
.
0040 LISTA EQU *
.
.
.
0054 ENDA EQU *
0054 REF4 WORD ENDA-LISTA+LISTC 000014
.
1
.
.
Location Source statement Object
code
0000 PROGC START 0
EXTDEF LISTC
EXTREF LISTA,ENDA
.
.
.
0030 LISTC EQU *
.
.
.
0042 REF4 WORD ENDA-LISTA+LISTC 000030
Fig. 1.a
H^PROGA ^000000^000063
D^……….. ^000040^ENDA ^……….
R^………...
.
.
M^000054^…^……………
.
.
H^PROGC ^000000^000051
D^LISTC ^………
R^………..^…………..
2
.
.
M^000042^…^……….
M^000042^…^.............
M^000042^…^……….
.
.
Fig. 1.b
3- State whether the following are true or false. If the answer is false, explain why.
a- Control section names need to be named in an EXTDEF statement.
b- The assembler sets the operand referring to external symbols to zeros.
3
Answer
1-
a- EXTDEF.
b- EXTREF.
2-
H^PROGA ^000000^000063
D^LISTA ^000040^ENDA ^000054
R^LISTC
.
.
M^000054^06^+LISTC
.
.
H^PROGC ^000000^000051
D^LISTC ^000030
R^LISTA ^ENDA
.
.
M^000042^06^+ ENDA
M^000042^06^-LISTA
M^000042^06^+PROGC
.
.
3-
a- False. Because they are automatically considered to be external symbols.
b- True.
4-
a- Control section.
b- Define record.
c- Refer record.