Skip to main content
Engineering LibreTexts

1.4: Compiling

  • Page ID
  • The Compile Process

    The process then to take the preprocessed code and turn it into executable code is a bit more complex. Depending on who you are talking to the steps may be a called something a bit different - but the actual process is the same, we will take a brief look at the steps in the next several pages.

    • High Level Language – refers to a programming language such as C++, Java, C#, etc. They are typically much easier for humans to read an understand than low level languages like machine code and assembly language.
    • Pre-Processor – The pre-processor removes all the directives and performs: file inclusion, macro-processing, performs conditional compilation as previously discussed
    • Assembly Language – Its neither in binary form nor high level. It is an intermediate state that is a combination of machine instructions and some other useful data needed for execution.
    • Assembler – For every platform (Hardware + OS) we will have a assembler. They are not universal since for each platform we have one. The output of assembler is called object file. Its translates assembly language to machine code.
    • Relocatable Machine Code – It can be loaded at any point and can be run. The address within the program will be in such a way that it will cooperate for the program movement.
    • Loader/Linker – It converts the relocatable code into absolute code and tries to run the program resulting in a running program or an error message (or sometimes both can happen). Linker loads a variety of object files into a single file to make it executable. Then loader loads it in memory and executes it.
    • Absolute Machine Code - This is the executable file, based on the system architecture and operating system it is to run on.

    Adapted from: "Introduction of Compiler Design" by Rajesh Kr JhaGeeks for Geeks is licensed under CC BY-SA 4.0