Program Construction | |||
It is good practice to break down a large program into a number of modules. Each of these modules may then be separately coded, compiled and tested. Working modules (standard modules) may then be used and incorporated into other programs. Advantages of using standard modules when programming..
To create the final program, these compiled modules will need to be linked together without needing to re-compile them. When a program is run, a procedure which is to be executed may be loaded into memory by the operating system. It is important that the procedure's code can run properly wherever in memory it is placed. For this reason, code should be compiled using relative and not absolute addresses.
Compilers need to create relocatable code - ie code that can be loaded and run anywhere in memory. This is particularly important in a multi-programming environment where a program may be swapped in and out of memory at a number of different places. The same principles apply to assembled code for low-level languages. |
|||