December
1998 QUESTION 3 Total Marks: 20 Marks |
Click here to access other
questions
SUGGESTED SOLUTIONS |
3. | (a) What is the basic purpose of a
compiler? |
[2] | |
The
basic purpose of a compiler is to translate source code (1 mark) into an equivalent
machine code representation (1 mark). Other sensible answers should also receive credit.
|
|||
(b) Describe four
differences which exist between a compiler and an interpreter. |
[4] | ||
One mark should be awarded for each correct difference named (up to a maximum of four marks). Examples include the following:
Other sensible answers should also receive credit.
|
|||
(c) Describe the five
functions performed by a compiler when source code is submitted for compilation. |
[10] | ||
One mark should be awarded for identifying each stage, and a further mark should be awarded for a satisfactory elaboration (up to a maximum of ten marks).
Other sensible answers should also receive credit.
|
|||
(d) Draw a diagram to illustrate the behaviour of each of the following types of loader: | |||
(i) Compile-and-go loaders. |
[2] | ||
Two marks should be
awarded for a correct diagram; only one mark should be awarded if flowchart conventions
are not followed; otherwise, no marks should be awarded. |
|||
(ii) Absolute loaders. | [2] | ||
Two marks should be
awarded for a correct diagram; only one mark should be awarded if flowchart conventions
are not followed; otherwise, no marks should be awarded |