0% found this document useful (0 votes)
49 views5 pages

Sheet 3.3

The document discusses assembly language concepts like modification records, literals, and relocatable programs. It asks questions about: [1] the purpose of modification records and assembler directives; [2] reasons for certain field lengths and which instructions don't need modifying; [3] determining modification record contents and relocated addresses from sample code; and [4] the accuracy of statements about assembler knowledge, instruction types needing modification, literal effects, and location. Key terms like relocatable program and literal are also defined.

Uploaded by

Mohamed Omar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views5 pages

Sheet 3.3

The document discusses assembly language concepts like modification records, literals, and relocatable programs. It asks questions about: [1] the purpose of modification records and assembler directives; [2] reasons for certain field lengths and which instructions don't need modifying; [3] determining modification record contents and relocated addresses from sample code; and [4] the accuracy of statements about assembler knowledge, instruction types needing modification, literal effects, and location. Key terms like relocatable program and literal are also defined.

Uploaded by

Mohamed Omar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Sheet (3.

3)
1- Complete the following statements
a- The assembler identifies for the loader the parts of the object program that
must be modified using ……….. record.
b- The modification record starts with letter ……..
c- The symbol ………. is used to specify literals.
d- The assembler directive ………. is used to place literals into a pool at
location other than the end of the object program.

2- Give reason(s) for each of the following.


a- The length field of a modification record is stored in half-bytes rather than
bytes.
b- Some instructions of the assembly program need not be modified when the
program is loaded.

3- Consider the following object code.


Line Location Source statement Object code
5 0000 COPY START 0
.
.
.
15 0006 CLOOP +JSUB RDREC 4B101036
.
.
.
45 001A ENDFIL LDA =C’EOF’ 032010
.
.
.

1
93 LTORG
002D =C’EOF’ 454F46
.
.
.
245 1073 RSUB 4F0000
255 END FIRST

a- Given that the format of modification record is

1 2-7 8-9
M Starting location of the address field to be modified Its Length

What are the contents of modification record for the instruction of line 15?
b- If this code is loaded into memory starting from address 7420, what is the
new target code of the instruction of line 15?
c- If line 93 is removed, where should literal =C’EOF’ be located in target
code?

4- State whether the following are true or false. If the answer is false, explain why.
a- The assembler knows the actual location where the program will be loaded.
b- The parts of the assembly program that require modification at load time are
those that specify relative (PC-relative or base-relative) addresses.
c- Register-to-register instructions need to be modified when the program is
loaded.
d- The effect of using literals is the same as if the programmer had defined a
constant and then used the label assigned to this constant as instruction
operand.
e- Normally literals are placed into a pool at the start of the program.

5- Write the scientific term of each of the following.

2
a- The object program that contains the necessary information to perform its
modification at load time.
b- An operand that has constant value written inside the instruction that uses it.
c- The basic data structure table using which assembler handles literal
operands.

3
Answer
1-
a- Modification.
b- M.
c- =.
d- LTORG.

2-
a- Because the address field to be modified does not necessarily occupy an
integral number of bytes
b- Because one of the following cases might happen
(1) The instruction operand is not a memory address at all (register-to-
register or immediate addressing instructions).
(2) The instruction operand is specified using PC-relative or base-relative
addressing.

3-
a- M00000705
b- 4B108456
c- At location 1076.
4-
a- False. It doesn’t know.
b- False. They are those that specify direct addresses.
c- False. They need not because their operands are not memory address.
d- True.
e- False. At the end of the program
f-
a- Relocatable program
b- Literal

4
c- Literal table LITTAB.

You might also like