1 / 8

Understanding Compilation: Steps, Processes, and Components

This guide delves into the intricacies of the compilation process in programming languages, highlighting key steps such as pre-processing, symbol collection, instruction generation, and linking. It outlines how compilation differs between languages like C/C++ and Java, emphasizing the workflow involving loaders, linkers, assemblers, and code generators. Discover the importance of multiple passes in compilers for error checking and optimization, as well as the role of object files and libraries in producing executable programs. Ideal for students and developers seeking to understand compiler design.

Télécharger la présentation

Understanding Compilation: Steps, Processes, and Components

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ISA is a Contract

  2. Compilers != Compilation • Compilation has multiple steps • pre-processing (non-existent for java) • finalizing the actual source listing • typically used for includes in a C/C++ program • translating (half-way done for java) • from high-level or assembly language • to machine instructions • building • combine your parts and system parts

  3. Essential Compilation Steps

  4. A Simple Translation Step • Most basic: two passes • first: collect and interpret symbols • second: line-by-line generation of instructions • Symbol = anything requiring interpretation • variable names • procedure/method names • your names and system names • opcodes and pseudo-instructions (in assembler)

  5. An Object File

  6. Typical Translation • Most compilers today have 3 or 4 passes • Extra passes enable a compiler to • do extended error checking • do extra optimization of resulting code • Most projects have many pieces • each piece (e.g. .c or .cc) translated individually • files ending in .o on Unix • files ending in .obj on Windows

  7. Linking • Once pieces translated, combine them • Each piece designed as relocatable module • External references get resolved • Complete executable built with parts • System parts often manifested as libraries • e.g. C library for unix applications • Shared libraries • Dynamically linked libraries

  8. Total Workflow Loader Linker Assembler Compiler Preprocessor Editor or Code Generator

More Related