Computer Program - Part 1
Computer Program - Part 1
A computer program is a set of commands that tells the CPU what to do. It is also called as software
or an application.
PROGRAMMING LANGUAGE
Programming language is a computer language, human-created language used to write instructions
for a computer. It is the language used for communicating with the computer. It is the set of rules
that provides the computer to perform certain operations. A language that is acceptable to a
computer system is called a computer language or programming language
PROGRAMMING
The process of writing instructions in such a language for an already planned program is called
coding or programming.
Example: To write an instruction ADD 2 and 3 then we may have to write 01100001(i.e. ADD)
00000010(i.e. 2) and 00000011(i.e. 3)
ASSEMBLER
The assembler is program that translates an assembly language program into an equivalent
machine language. The assembly language program is referred to as “Source Program” whereas;
the machine language program is referred as “Object Program”. Assembler also assembles the
machine language programs into main memory of the computer and makes it ready for execution.
ASSEMBLY MACHINE
LANGUAGE ASSEMBLER LANGUAGE
HIGH-LEVEL LANGUAGE
High-level languages were designed to overcome their limitation such as machine dependent and
machine level coding. They are similar to written English. Their syntax is more like a human
language.
3. Fewer errors: While programming in a high-level language, a programmer need not worry
about how and where to store the instructions and data of the program, and need not write
machine-level instructions for the steps carried out by the computer.
4. Lower program preparation cost: Writing programs in high-level languages require less
time and effort, which ultimately lads to lower program preparation cost.
5. Better documentation: The statements of program written in a high-level language are very
similar to the natural language statement use d by us in our day-to-day life. Hence a
programmer familiar with the problem domain can easily understand them. As a result, very
few, or practically no separate comment is required in program written in high-level language.
6. Easier to maintain: Programs written in high-level language are easier to maintain, they are
easier to understand, and hence, it is easier to locate, correct and modify instructions as and
when desired.
COMPILER
Since computer can directly execute only machine language programs, a high-level language
program must be converted into its equivalent machine language program before it can be executed
on the computer. This is done with the help of translator program, which is known as a compiler.
A compiler is a translator program, which translates a high-level languages program into its
equivalent machine language program. Compiler is language dependent. FORTAN compiler can’t
compile COBOL program. In additional to translating, compiler also automatically detects and
indicates certain type of errors in source programs.
LINKER
Linker is a program that combines all the object program and library program collectively to
convert them to final executable program. Linkers are found in high-level languages like C, C++,
VC++, Java, etc.
Source Program
LINKER
Machine
Language
Object Program
Fig: Linker