Steps of Compilation
Axel Bouvier 02/03/2022

Steps of Compilation

Four Steps of Compilation:

  • Preprocessing

Compiling

  • Assembly
  • Linking

Preprocessing: Is the first step, it´s function is to remove comments, expanding macros and expanding included files. All preprocessor commands begin with a hash symbol (#). It must be the first nonblank character, and for readability, a preprocessor directive should begin in the first column.

Compiling: Compiling is the second step. It takes the output of the preprocessor and generates assembly language, an intermediate human readable language, specific to the target processor.

Assembly: During this stage, an assembler is used to translate the assembly instructions to object code (binary code). The output consists of actual instructions to be run by the target processor.

Linking: The object code generated in the assembly stage is composed of machine instructions that the processor understands but some pieces of the program are out of order or missing. To produce an executable program, the existing pieces have to be rearranged and the missing ones filled in. This process is called linking.

The linker will arrange the pieces of object code so that functions in some pieces can successfully call functions in other ones. It will also add pieces containing the instructions for library functions used by the program.

The result of this stage is the final executable program.



To view or add a comment, sign in

More articles by Axel Bouvier

  • 🚀 OpenAI lanza sus primeros modelos Open-Weight

    Modelos disponibles: GPT‑OSS 120B 117 mil millones de parámetros totales, con solo 5.1 mil millones “activos” en cada…

  • Agentes IA

    Durante los últimos años, el término "inteligencia artificial” se ha popularizado al punto de volverse un lugar común…

  • 🚀✨ ¡Travel Web Page - DIW 1! ✨🚀

    Acabo de publicar VIAJAUY, una página web de viajes que desarrollé para un obligatorio de la materia Diseño de Interfaz…

    1 Comment
  • IoT - Internet of Things

    What is IoT? The Internet of Things (IoT) is a network of physical objects that are fitted with sensors, software and…

  • Recursion

    What is recursion? Recursion is a process by which a function calls itself directly or indirectly. The corresponding…

  • Python3: Mutable, Immutable... everything is object!

    In this blog I will introduce concepts about objects (an object is simply a collection of data (variables) and methods…

  • What happens when you type "ls -l *.c" in the shell?

    What happens when you type `ls -l *.c` in the shell? This article was made to explain what happens when you run the…

  • Static Libraries

    Static libraries are simply a collection of ordinary object files; conventionally, static libraries end with the ``.a''…

  • Hard and Symbolic Links

    Hard and Symbolic links! What is hard link and symbolic link in linux? Hard links and symbolic links are two different…

Explore content categories