Java Reference
In-Depth Information
1.2 What Compilers Do
Figure 1.1 represents a compiler as a translator of the programming language
being compiled (the source ) to some machine language (the target ). This de-
scription suggests that all compilers do about the same thing, the only di
er-
ence being their choice of source and target languages. However, the situation
is a bit more complicated. While the issue of the accepted source language is
indeed simple, there are many alternatives in describing the output of a com-
piler. These go beyond simply naming a particular target computer. Compilers
may be distinguished in two ways:
ff
By the kind of machine code they generate
By the format of the target code they generate
These are discussed in the following sections.
1.2.1 Machine Code Generated by Compilers
Compilers may generate any of three types of code by which they can be
di
ff
erentiated:
Pure Machine Code
Augmented Machine Code
Virtual Machine Code
Pure Machine Code
Compilers may generate code for a particular machine's instruction set with-
out assuming the existence of any operating system or library routines. Such
machine code is often called pure code because it includes nothing but instruc-
tions that are part of that instruction set. This approach is rare because most
compilers rely on runtime libraries and operating system calls to interfacewith
the generated code. Pure machine code is most commonly used in compilers
for system implementation languages , which are intended for implementing
operating systems or embedded applications. This form of target code can
execute on bare hardware without dependence on any other software.
 
 
 
Search WWH ::




Custom Search