X hits on this document

378 views

0 shares

0 downloads

0 comments

18 / 120

To relieve a high-level language compiler from the difficult task of generating

machine instructions, some compilers do not generate machine code directly, instead they

generate code in a low-level language such as assembly [8]. This allows for a separation

of concerns where the compiler doesn't have to know how to encode and format machine

instructions for every target platform or processor--it can instead just concentrate on

generating valid assembly code for an assembler on the target platform. Some compilers,

such as the C and C++ compilers in the GNU Compiler Collection (GCC), have the

option to output the intermediate assembly code that the compiler would otherwise feed

to the assembler—allowing advanced programmers to tweak the code [9]. Therefore the

C and C++ compilers in GCC are examples of compilers that translate high-level

language programs to assembly code instead of machine code; they rely on an assembler

to translate their output into instructions the target processor can understand. [9] outlines

the compilation process undertaken by GCC compiler to render an executable file is as

follows:

Preprocessing: Expand macros in the high-level language source file.

Compilation: Translate the high-level source code to assembly language.

Assembly: Translate assembly language to object code (machine code).

Linking (Create the final executable):

Statically or dynamically link together the object code with the object code

of the programs and libraries it depends on.

10

Document info
Document views378
Page views379
Page last viewedFri Dec 09 12:03:59 UTC 2016
Pages120
Paragraphs2913
Words25794

Comments