How to actually optimize a process

A process transforms inputs into outputs. It is a great challenge to dive into a process, break it down and optimize it. It is an even greater challenge to think bigger and review the inputs of that…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




What happens when you compile your first file in C

Because of this low-level nature, programs written in C need to go through a compiler, which involves four steps: Preprocessing, Compiling, Assembly, and Linking.

Preprocessing

The preprocessor generates an intermediate file that is ready for assembly. This takes out any commented language, includes header files in the source code, and replaces macro names with code. A file is generated after this process.

Use the command above to create a file showing the preprocessing stage of compilation.
The hello.c file at the preprocessed stage of compilation.

Compiling

At the compiling stage, the preprocessed language is converted to assembly language, which are still English words and mnemonics.

Use the command above to create a file showing the assembly language after compiling.

Assembly

The assembler then converts the assembly code to object code, which is in binary format. Several files of object codes are generated after this process.

Use the command above to create a file showing the object code after assembly.

Linking

The files generated are made of machine instructions, but are out of order. To make an executable file, these files need to be rearranged and instructions for library functions will be added, then finally packaged into an executable file.

Add a comment

Related posts:

Morning Muffin and Juice

At the tender age of 8, my daddy reminded me that I’d lived in his balls before I lived in his house. And so I’d have to follow his rules. And that one day I would have kids of my own. And I would…

Beyond This

I fell into a chasm to find it. Pressing ever deeper, darker. It was the only way I knew how to look. Gradually my eyes opened and I thought I glimpsed it. The smell, the look, the taste, the touch…

GerryDANdering Texas

Democrats who long for honest, no-nonsense government were elated by this month’s election results in Virginia and New Jersey. Here in Texas, Democrats from all walks of life are putting their work…