8/27/20

Introduction to programming Compilation

 

Computer Programming Through ‘C’





1.    INTRODUCTION TO PROGRAMMING (Part-2)

Compilation

 Linking and Loading

Testing and Debugging

 Documentation:  Programming Style-Names, Documentation & Format, Refinement & Modularity

Compilation: -

1.     The process of converting the source code i.e. high level language into object code i.e. machine language is known as compilation.

2.     The computer takes a process to convert high level programming language into a machine language or low level language that language understood by the computer is known as compilation.

3.     In other words we can say that compiler is software which converts a program written in high level language as source code into low level language/ object code target code/ machine language.

4.     The software which performs compilation or conversion of code is called a compiler.

5.     In C programming, the process compilation converts the source code taken as input into the object code or machine code.

6.     The process of compilation can be divided into four steps these steps are as follows:

a.  Pre-processing

The source code written in high level language is first passed to the processor and processor expands this code then this expanded code is path to the compiler.

b.  Compiling

The code which is passed by the processor the compiler converts this code into assembly code.

c.  Assembling and

The Assembly code which is converted by the compiler now converted into object code by using an assembler.

d.  Linking.

Linker combines the object code of library files with the object code of our program.

Linking: -

1.     A C program is made up of many functions and we write some of these functions as a part of our source program, the linker assembles of this function and combines them to produce a single executable file.

2.     In the stage of compilation linking is the final stage and it takes one or more object files or libraries as input and assembles them into our final executable programs.

3.     The process of binding the object files and another program into an executable program is called as linking.

4.     Linker is a program in a system which helps to link object files or object module of programs into a single object file and it performs the process of linking.

5.     Linking is performed at both time, at the time of compile, when the source code translated into machine code as well as load time, when the program is loaded into memory by the loader.

6.     There are two types of linking

a.       Static linking and

b.       Dynamic linking

Static Linking: -

·        Static linking is performed during the compilation of source program and it takes collection of re-locatable object file and command line argument and generates fully linked object file that can be loaded and run.

·        Static linker performs two measure tasks: -

Symbol resolution

Relocation

Dynamic linking: -

·      Dynamic linking is performed during the run-time and it is accomplished by placing the name of a shareable library in the executable image.

·      In dynamic linking there is a more chances of error and failure

·      Dynamic linking requires less memory space as multiple programs can share a single copy of the library.

 

Loading: -                        

1.     Loader is a part of an operating system which is responsible for cold loading executable files from the disk into the primary memory i.e. Ram and execute them.

2.     Loader calculates the size of the program according to instructions and data and creates memory space for program.

3.     Loader is a type of special program that takes input from linker as object code and loads it to main memory and prepare this code for executed by computer.

4.     Loader is used to allocate memory space to program.

5.     Loader has three types of approach:

a.       Absolute loading

b.        Re-locatable loading

c.        Dynamic run-time loading

 Difference between Linking and Loading

Testing: -

1.   The process of verifying and validating that a program is error free.

2.   Testing is the process of identifying the value of implemented code.

3.   The process of finding errors in a program is called testing.

4.   Testing can increase our confidence that a program is error free or not.

5.   Testing small program is much easy than the testing of the large program.

6.   We should test our program with expected and unexpected input that is also called testing.

7.   Testing is of two types: -

a.   Black box testing

b.   White box testing

 

Debugging: -

1.   The process of fixing a bug in a program is called debugging.

2.   Debugging can be defined as the identifying, analyzing and removing errors.

3.   Activity of debugging begins after the failure of programs to execute properly and concludes by solving the problem and successfully testing the program.

4.   Debugging is considered to be an extremely complex task because errors need to be resolved at all stages of the debugging.

 

 

Difference between testing and debugging? 

Introduction to programming (Part-1)


 

1 comment:

  1. Sir aap Jo notes likhe hai oh bahut aacha hai but sir mujhe lagta hai aap bahut deep me likhe hai exam point of view se thik hai ya Thora jayada hi deep me hai
    And thanks sir aap hamlogo ke liye itna mehnat karte hai

    ReplyDelete

Please do not enter any spam link in the comment box and use English and Hindi language for comment.

Latest Update

Queue data structure

Popular Posts