The advantage of the modern approach is that compilers
for different languages can create intermediate code in the common form, which intermediate code can be fed
to a common machine language generator.
The result of compiling a program is a file of object code, which is the binary file of machine instructions that
will be executed when the program is run. Compilers create a special type of object code called relocatable code,
which is object code that can be loaded into any part of memory. When the program is loaded into memory to run,
addresses and references in relocatable files are adjusted to reflect the actual location of the program in memory.
With compilers, the translation of source code to executable code is accomplished once. Once the program is
compiled, executing the program requires no translation, and the program in machine code form executes swiftly.
Interpreters operate differently. Interpreters translate the source code to machine code one source code line
at a time, and they do this every time the program executes. The interpreter is always the program in control; it is
48 SOFTWARE [CHAP. 4
the interpreter that is actually executing when a program in an interpreted language is run.
Pages:
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140