The compilation process is the procedure code goes through to go from high-level programming languages into machine code that the hardware understands. Most languages go through some semblance of this four-stage process:
Preprocessing is the first step and is used to prepare the user’s code for machine code by removing comments, expand included macros, and perform any code maintenance prior to handing the file to the compiler.
Compiling is the process of taking the expanded file from the preprocessor and translating the program into the Assembly language that is designated by the ISA. Program optimization is also a key part of this step.
Assembling is the process of taking an Assembly language program and using an assembler to generate machine code for use by the computer hardware.
Linking is the process of filling in function calls, including additional objects, libraries, and source code from other locations into the main binary code so it is ready to be executed by the processor.
Assembly language is a low-level programming language used to directly correspond with machine code. It begins with an opcode and then references memory locations or data types to operate on.
"Hello, World" in x86 Assembly Language:.global _start.text_start:mov $1, %raxmov $1, %rdimov $message, %rsimov $13, %rdxsyscallmov $60, %raxxor %rdi, %rdisyscallmessage:.ascii "Hello, world\n"