Hardware Reference
In-Depth Information
language is not directly executed. Instead, it is converted to an equivalent program
called an object program or executable binary program whose execution is car-
ried out only after the translation has been completed. In translation, there are two
distinct steps:
1. Generation of an equivalent program in the target language.
2. Execution of the newly generated program.
These two steps do not occur simultaneously. The second step does not begin until
the first has been completed. In interpretation, there is only one step: executing the
original source program. No equivalent program need be generated first, although
sometimes the source program is converted to an intermediate form (e.g., Java byte
code) for easier interpretation.
While the object program is being executed, only three levels are in evidence:
the microarchitecture level, the ISA level, and the operating system machine level.
Consequently, three programs—the user's object program, the operating system,
and the microprogram (if any)—can be found in the computer's memory at run
time. All traces of the original source program have vanished. Thus the number of
levels present at execution time may differ from the number of levels present be-
fore translation. It should be noted, however, that although we define a level by the
instructions and linguistic constructs available to its programmers (and not by the
implementation technique), other authors sometimes make a greater distinction be-
tween levels implemented by execution-time interpreters and levels implemented
by translation.
7.1 INTRODUCTION TO ASSEMBLY LANGUAGE
Translators can be roughly divided into two groups, depending on the relation-
ship between the source language and the target language. When the source lan-
guage is essentially a symbolic representation for a numerical machine language,
the translator is called an assembler and the source language is called an assembly
language . When the source language is a high-level language such as Java or C
and the target language is either a numerical machine language or a symbolic
representation for one, the translator is called a compiler .
7.1.1 What Is an Assembly Language?
A pure assembly language is a language in which each statement produces ex-
actly one machine instruction. In other words, there is a one-to-one corre-
spondence between machine instructions and statements in the assembly program.
If each line in the assembly language program contains exactly one statement and
 
 
 
Search WWH ::




Custom Search