December 1999
SW204 : SOFTWARE AND
FILE DESIGN

QUESTION 3

Total Marks: 15 Marks

Click here to access other questions

SUGGESTED SOLUTIONS
Solutions and allocated marks are indicated in green.
Return to
Question 3

(a)

Describe the term loader .
A loader is a program which accepts object code (1 mark),and prepares it for execution (1 mark). Other valid answers should also receive credit.

 

[2]
(b)

Describe four functions which a loader must perform.
One mark should be awarded for each of the following:

•Allocate space in memory for the program(s).
•Resolve symbolic references between object codes.
•Adjust all address dependent locations to correspond to the allocated space.
•Physically place the machine instruction and data into memory.

 

[4]
(c)

(i)Describe how a compile-and-go loader works.[2marks ]
Translators run in one part of the memory and the translated machine instructions and data are assembled and placed directly into their assigned memory locations (1 mark).When the program assembly is completed,the loader transfers to the starting instruction of the newly translated program (1 mark). Other valid answers should also receive credit.

(ii)List three drawbacks associated with compile-and-go loaders.
[3 marks ]
One mark should be awarded for each disadvantage named (up to a maximum of three marks).Examples include the following:

•The portion of memory occupied by the translator is wasted,as object code cannot use uch of that memory.
•The program has to be translated each time it is run.
•It is difficult to handle ultiple segments,especially if different segments of source code are in different languages.
•It is difficult to produce orderly modular programs. Other valid answers should also receive credit.

(iii)How does an absolute loader differ from a compile-and-go loader?
[1 mark ]
An absolute loader does not store object code directly in memory.

(iv)List one benefit associated with absolute loaders.[1 mark ]
More memory is available to the user. Other valid answers should also receive credit.

(v)How are allocation and relocation accomplished by an absolute loader?[2marks ]
By the programmer (1 mark)and the assembler (1 mark) respectively.

[9]