Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 9

C Development Environment

Disk

Phase 2 :
Preprocessor
program
processes the
code.


Disk
Compiler Phase 3 :
Compiler
creates object
code and stores
it on Disk.
Preprocessor
Disk
Linker Phase 4 :
Linker links object
code with libraries,
creates a.out and
stores it on Disk.
Editor Phase 1 :
Program is
created in the
Editor and
stored on Disk.
Disk
Loader Phase 5 :
:
.
Primary
Memory

Loader puts
Program in
Memory
C P U Phase 6 :
:
.
Primary
Memory
CPU takes each
instruction and
executes it, storing
new data values as
the program executes.

From code to executables
Pre-processor
Source Code
Compiler
Assembler
Linker
Libraries
Assembly Code
Object Code
Executable Code
Phases in Development of a
Program
Developing the program
Compiling the program
Linking the program
Testing the program
Documenting the program

Developing the program
Study the problem
After detailed study, Identify the output required
from program
Identify Input data
Prepare a detailed list of steps called Algorithm
Translate the steps in a computer program in C
Store the program (source code) in a disk file
with extension .c
Compiling the program
To translate the program into machine language using a
C compiler
C compiler has in-built pre-processor
Pre-processor processes source code before passing to
the compiler
Directives (Pre-processor commands) tell the pre-
processor to process the code.
Expanded version of source code is produced
C compiler takes the expanded version of source code
and produces a machine code (object code) and saved
in a disk file with same name with extension .obj if there
are no syntax errors.
If there are errors, compiler prints the appropriate
messages called diagnostics messages


Linking the program
Machine code version is not in the form
that you can run
To produce an executable code, known
as run file , object codes are linked
together with library functions
After linking process is over , a disk file
with same name but with extension .exe
is produced

Testing the program
To assure that program is correct and gives the
desired output
Program is executed with all possible values of
input data
If output matches the desired results then it is
correct
In case it does not match, source code scanned
to find out logical errors (errors in designing the
algorithm or while coding)
Process of debugging takes place

Documenting the program
Recording the important information
regarding the program
Enables everyone to understand the logic
and purpose of the program
Facilitate in the maintenance and
upgradation

You might also like