Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Stages involved in compling a program

Status
Not open for further replies.

nirmala h

Member level 1
Joined
Jan 18, 2011
Messages
36
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,288
Location
Bangalore, India
Activity points
1,530
Hi All,

Could anyone tell me clearly what are all the steps involved in compling this simple program(each & every steps).

#include<stdio.h>
main()
{
printf("Hello");
}
 

Here is a good link
1.h**p://www.acm.uiuc.edu/sigmil/RevEng/ch02.html


2.h**p://www.personal.kent.edu/~rmuhamma/Compilers/compiler.html
 
Hi
There are 5 stages of compilation in C program
1. pre-processing
2. compiling
3. Assembling
4. Linking
5. Loading

At pre-processing stage mainly the compiler does three things they are including source code of headers, comment deletion, macro substitution...
At compiling stage the compiler converts source code into assembly code
At assembling stage the compiler converts assembly code to machine code
At linking stage links the different object files into single file
finally at loading stage the executable file moves to into memory....

You can clearly see this all using GCC compiler

the commands are 1. pre-processing------>gcc -E file.c> file.i
2. Compiling-----------> gcc -S file.c>file.s
3.Assembling---------->gcc -c file.c

this is the compilation process
 
If you have any additional questions concerning ANSI C or Embedded C, you may want to checkout the group:

Embedded C/C++ Programming

I have posted numerous links to C tutorials, C compilers and sample projects and while the group was specifically setup for C development in Embedded Systems, there are plenty of material for ANSI C.

BigDog
 
Last edited by a moderator:
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top