COMPILING, LINKING, AND LOADING A PROGRAM
A program, written in source language, is translated by the compiler to produce a program in a target language. The source language is usually a high-level language. The target language may or not necessarily be machine language. In most cases, the target language is assembly language, and in which case, the target program must be translated by an assembler into an object program. Then the object program is linked with other object programs to build an executable program, which is normally saved in a specified location of the secondary memory. When it is needed to be executed, the executable file is loaded into main memory before its execution. The whole process is managed, coordinated and controlled by the underlying operating system. Sometimes the target language may be a language other than machine or assembly language, in which case a translator for that language must be used to obtain an executable object program.