This document discusses the execution process of a C language program. It begins by outlining the main steps: assembler, compiler, linker, interpreter, and loader. It then provides more details on each step. Specifically, it describes the different types of assemblers, compilers, and their purposes. It also explains the roles of the linker, interpreter, and loader. The document concludes by defining algorithms and flowcharts, discussing their properties and symbols used in flowcharts. It notes the advantages and limitations of using flowcharts.
4. ASSEMBLER
• Computer understand machine language.
• Other language must be translated.
• This translation is done with the help of software
(Assembler).
• Types :
• Self ( Resident )
If an assembler which runs on a computer and
produces the machine codes for the same computer
then it is called self assembler or resident assembler.
• Cross
If an assembler that runs on a computer and
produces the machine codes for other computer then it iselectrohybridTech
4
5. • Types
• One pass
One pass assembler is the assembler which assigns the
memory addresses to the variables and translates the source
code into machine code in the first pass simultaneously.
• Two pass
-A Two Pass Assembler is the assembler which
reads the source code twice.
-In the first pass, it reads all the variables
and assigns them memory addresses.
-In the second pass, it reads the source
code and
translates the code into object code.electrohybridTech
5
6. COMPILER
• High level lang. to Machine level lang.
• low speed (but faster than interpreter) and more
memory
• Types
• Self ( Resident)
• If a compiler runs on a computer and produces the machine
codes for the same computer then it is known as a self
compiler or resident compiler.
• Cross
• if a compiler runs on a computer and produces the
machine codes for other computer then it is known as a
cross compiler.electrohybridTech 6
7. INTERPRETER
• Translates statements of a program into
machine code.
• It translates only one statement of the
program at a time.
• A compiler is faster than an interpreter.
• Small program as compared to compiler
• Less memory
electrohybridTech 7
9. LINKER
• Header files which contain functions to be executed.
• These functions are linked to the libraries by a
program called Linker.
• If no linking, informs compiler and compiler generates
error.
• The compiler automatically invokes the linker as the
last step in compiling a program.
• If large prog., divides into subprog.(modules) and these
modules are combined to execute.
• The process of combining the modules is done by the
linker.electrohybridTech 9
10. LOADER
• Loader is a program that loads machine codes of
a program into the system memory.
• It is one of the essential stages in the process
of starting a program.
• Loading a program involves reading the contents
of executable file into memory.
• Once loading is complete, the operating system
starts the program by passing control to the
loaded program code.
electrohybridTech 10
11. ALGORITHMS
• A SEQUENTIAL SOLUTION OF ANY PROGRAM THAT WRITTEN IN
HUMAN LANGUAGE, CALLED ALGORITHM.
• ALGORITHM IS FIRST STEP OF THE SOLUTION PROCESS, AFTER THE
ANALYSIS OF PROBLEM, PROGRAMMER WRITE THE ALGORITHM OF
THAT PROBLEM.
electrohybridTech 11
12. PROPERTIES OF THE ALGORITHM
1) Finiteness: - an algorithm terminates after a finite numbers of
steps.
2) Definiteness: - each step in algorithm is unambiguous. This
means that the action specified by the step cannot be interpreted
(explain the meaning of) in multiple ways & can be performed
without any confusion.
3) Input:- an algorithm accepts zero or more inputs
4) Output:- it produces at least one output.
5) Effectiveness:- it consists of basic instructions that are realizable.
This means that the instructions can be performed by using the
given inputs in a finite amount of time.electrohybridTech 12
13. FLOWCHART
• Graphical representation of any program is called
flowchart.
• The flowchart is a means of visually presenting the
flow of data, the operations performed and the
sequence in which they are performed to solve a
problem.
• Flowcharts are generally drawn in the early stages of
formulating computer solutions. These flowcharts play
a vital role in the programming of a problem and are
quite helpful in understanding the logic of complicated
and lengthy problems. Once the flowchart is drawn, it
becomes easy to write the program in any high level
language. Flowcharts are helpful in explaining theelectrohybridTech
13
14. FLOW CHART SYMBOLS
Oval Terminal
Parallegram Input/output
Rectangle Process
Document Hard copy
Diamond Decision
Circle Connector
Double sided Rectangle Sub program
Hexagon Iteration
Trapezoid Manual Operation
Cylinder Magnetic Disk Storage
electrohybridTech
14
15. ADVANTAGES OF USING
FLOWCHART
• Communication: Flowcharts are better way of
communicating the logic of a system to all concerned.
• Effective analysis: With the help of flowchart,
problem can be analyzed in more effective way.
• Proper documentation: Program flowcharts serve as
a good program documentation, which is needed for
various purposes.
• Efficient Coding: The flowcharts act as a guide or
blueprint during the systems analysis and program
development phase.
• Proper Debugging: The flowchart helps in
debugging process.
electrohybridTech
15
16. LIMITATIONS OF USING
FLOWCHARTS
• Complex logic: Sometimes, the program logic
is quite complicated. In that case, flowchart
becomes complex and clumsy.
• Alterations and Modifications: If alterations
are required the flowchart may require re
drawing completely.
electrohybridTech 16
17. PSEUDOCODE
• Pseudocode is an informal high-level description of
the operating principle of a computer program or
other algorithm.
• Pseudocode typically omits details that are not
essential for human understanding of the
algorithm.
• The purpose of using pseudocode is that it is
easier for people to understand than conventional
programming language code.
electrohybridTech 17
18. Algorithm: Step by step procedure of solving a particular problem.
Pseudo code: Artificial informal language used to develop algorithms.
Flow chart: Graphical representation of an algorithm.
Algorithm to find whether a number even or odd:
Step1: Begin Step1: START
Step2: Take a number Step2: Read num
Step3: if the number is divisible by2 then Step3: if(num%2=0) then
print that number is even print num is even
otherwise print that number is odd otherwise
print num is odd
Step4: End Step4: STOP
(Algorithm in natural language) (Algorithm by using pseudo code)
#include<stdio.h>
#include<conio.h>
main()
{
int num;
printf(“Enter any number”);
scanf(“%d”,&num);
if(num%2==0)
printf(“%d is even”,num);
else
printf(%d is odd”,num);
}
(Program in C language)
start
read
num
print
num is
even
stop
If
num%2
=0
print
num is
odd
Flow
chart:
Yes No
electrohybridTech
18
A computer will not understand any program
written in a language, other than its machine language. The
programs written in other languages must be translated into the
machine language. Such translation is performed with the help of
software. A program which translates an assembly language
program into a machine language program is called an
assembler. If an assembler which runs on a computer and
produces the machine codes for the same computer then it is
called self assembler or resident assembler. If an assembler that
runs on a computer and produces the machine codes for other
computer then it is called Cross Assembler.
Compiler: It is a program which translates a high level language
program into a machine language program. A compiler is more
intelligent than an assembler. It checks all kinds of limits, ranges,
errors etc. But its program run time is more and occupies a
larger part of the memory. It has slow speed. Because a compiler
goes through the entire program and then translates the entire
program into machine codes. If a compiler runs on a computer
and produces the machine codes for the same computer then it is
known as a self compiler or resident compiler. On the other
hand, if a compiler runs on a computer and produces the
machine codes for other computer then it is known as a cross
compiler.
Linker: In high level languages, some built in header files or
libraries are stored. These libraries are predefined and these
contain basic functions which are essential for executing the
program. These functions are linked to the libraries by a program
called Linker. If linker does not find a library of a function then
it informs to compiler and then compiler generates an error. The
compiler automatically invokes the linker as the last step in
compiling a program.
Not built in libraries, it also links the user defined
functions to the user defined libraries. Usually a longer program
is divided into smaller subprograms called modules. And these
modules must be combined to execute the program. The process
of combining the modules is done by the linker.
Loader: Loader is a program that loads machine codes of a
program into the system memory. In Computing, a loader is the
part of an Operating System that is responsible for loading
programs. It is one of the essential stages in the process of
starting a program. Because it places programs into memory and
prepares them for execution. Loading a program involves
reading the contents of executable file into memory. Once
loading is complete, the operating system starts the program by
passing control to the loaded program code. All operating
systems that support program loading have loaders. In many
operating systems the loader is permanently resident in memory
It is a sequence of instructions to be carried
out in order to solve a specific problem. In
designing a solution, we write step by step
procedures for solving the problem. Such
process is called algorithm. Algorithm can be
written in any language according to the
convenience of the program developer.
The flowchart is a means of visually presenting
the flow of data, the operations performed and the
sequence in which they are performed to solve a
problem.
A flowchart is a diagrammatic representation that
represents the sequence of operations to be
performed to get the solution of a problem.
Flowcharts are generally drawn in the early stages
of formulating computer solutions.
These flowcharts play a vital role in the
programming of a problem and are quite
helpful in understanding the logic of
complicated and lengthy problems. Once the
flowchart is drawn, it becomes easy to write
the program in any high level language.
flowcharts are helpful in explaining the
program to others.