x86 Toolchain of C Programming

x86 is a Instruction set architecture (ISA) or in simple term Computer architecture developed by Intel in 1978. We also knows as Intel 8086 microprocessor. Most of personal computers, gaming consoles, laptops are based on x86 architecture till today.

A Toolchain is set of Programming tools that are used to create a software.The Tools are used in a chain, so that the output of each tool becomes input for the next tool.

Process of Tool chain

Components of Toolchain:

  1. Editor: Editor is a program where we write and edit our code. kwrite and gedit are the example of editors. It gives .c File of C Program.
Program.c file
Command for compilation of Program and view temporary files

2. Preprocessor: As its name it is used for Pre processing. It expands pre processor directives such as #include, #define etc. It performs task like File Inclusion, Macro Expansion, Condition Compilation, Comment Removal, Extra Whitespace Removal. It gives output file in ‘ .i ‘ extension format, (.i) means intermediate code (Human Readable)

intermediate file (Program.i)

3. Compiler: It is used to translate Human Readable code to Machine dependable code (Assembly Language). It gives output file in assembly language which is machine dependable means every microprocessor has different assembly like Intel assembly is different, ARM microprocessors assembly is different (.asm or .s )

Assembly file

4. Assembler: It converts Machine Dependable code to Machine Understandable code (Binary). It gives output in form of Object file (.obj) and it is a non-executable file. Cannot view .obj file as it is contains 0s and 1s so no point to view file.

5. Linker: Linker used to link one or more object file together. It includes Primary Header which contains Address of enrty point function, Timestamp, Type of executable and Magic number.

6. Loader: it loads .exe file from Hard Disk (secondary storage device) to RAM (Random access memory) Primary storage device.

This is just a small introduction of Tool chain of C Program to executable file journey.

A void

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store