From Wikipedia, compilation is "the translation of source code into object code by a compiler."
"Execution in computer and software engineering is the process by which a computer or a virtual machine carries out the instructions of a computer program."
look when we run a program, in say c++, it involves preprocessing, compiling, linking.... k?
so in a similar way i want to know what are various steps involved in comliation and execution, when we try to run a program or process or lets say some game in windows?
As kbw pointed out compilation and execution are two separate things. Compilation is the process of turning your code into assembly instructions that the processor can then understand, this is stored as something called a binary executable file. Execution is when this binary file is loaded into memory and interpreted by the processor. This is potentially a very large subject, you really need to be more specific.
After the compile and linking process, on Windows, you are left with your executable program file. This is usually given a .EXE extention, and is in a file format known as the PE executable, or PE/COFF.
This file, in addition to your executable code and compiled program data, also holds a list of references to functions stored within Dynamic Link Libraries, or DLL. A DLL is also stored in the PE format, and contains of list of the functions that it contains.
The load and execute process on Window is very complex, but as an over view, it looks something like this:
1. Some program (usually the shell or the command interpretor) asks the operating system to execute a specific executable file.
2. If the file exists, Windows creates a "Process" with a new virtual address space and maps the contents of the executable file into memory.
3. Windows reads the DLL import list from the executable and tries to load each DLL required.
4. If all the DLLs load successfully, Windows uses information within the executable to "link" the executable code with the code in the DLLs.
5. The program is now ready to run, and will be scheduled as a new thread.
6. Execution continues until your program either generated an unhandle exception or terminates normally.
If you find this topic interesting, you may enjoy the site sysinternals.com.