Sie sind auf Seite 1von 3

Topics Covered (Module 1)

1. Assembly Language
2. High Level Language (HLL)

CPinC-J

ME14 302 Computer Programming in C


Uday Babu P.
Vidya Academy of Science and Technology

I. Programming Languages
Programming languages are used by programmers to develop programs. Program is a
sequence of instructions to be executed by the computer.
Programming languages are classified into three broad categories:1. Machine Language (Refer CPinC-G)
2. Assembly Language
3. High Level Language
1A. Assembly Language
1. Assembly Language is the second generation programming language. Machine language
is the first generation programming language.
2. Assembly Language is a low level language.
3. A short symbolic code (ADD, SUB, MUL, DIV) called mnemonic is used to represent
each instruction. The mnemonic for a particular instruction consists of letters that
suggest the operation to be performed by that instruction.
4. Programs written in assembly language using the mnemonics is called assembly
language program. The complete set of mnemonics for a microprocessor constitutes its
assembly language.
8085 Assembly Language Program to add two numbers 03H and 05H :MVI A,03H
MVI B,05H
ADD B
In 8085 microprocessor,
ADD is the mnemonic for addition
SUB is the mnemonic for subtraction
In 8085 microprocessor, ADD B instruction adds contents of register B to contents of register A
and stores the sum in register A. 1000 0000 was the corresponding binary code for ADD B
instruction.

ME14 302 Computer Programming in C Uday Babu P Vidya Academy of Science and Technology. 1

Advantages
1. Programs in assembly language is more efficient in terms of hardware performance
compared to Programs in high level language. Programs in assembly language run
faster when compared to Programs in high level languages.
2. Assembly Language Programs are easier to develop, understand, read and debug
compared to machine language programs.
Disadvantages (Study any two or three easy disadvantages only)
1. Assembly Language & machine language are Machine dependent languages
(microprocessor specific). Each microprocessor has a unique assembly language.
2. An assembly language program written for one microprocessor is not transferable (not
portable) to a computer with another microprocessor unless the two microprocessors
are compatible.
3. Assembly Language Programs cannot be executed directly by the microprocessor.
Assembler is required to translate Assembly Language Program into machine code
before execution by microprocessor.
4. Developing Programs in assembly language is tedious and error-prone compared to
developing programs in high level languages.
5. Debugging assembly language programs is tedious compared to Debugging programs
in high level languages.
6. Assembly Language Programs are less efficient than machine language programs.
1B. High Level Language
1. High-Level Languages began with the third generation.
2. High-Level Language uses English-like phrasing. High-level language use statements
consisting of English-like keywords such as "for", "include", "if", ... etc.
3. High-Level Language is close to the human language.
4. High-Level Languages are Machine independent and Portable.
5. Data are referenced using descriptive names like sum, area,.. etc
6. Operations can be expressed using familiar symbols like +,-,... etc .
Example:- Cost = Price + Tax
7. Examples of High Level Languages are Third Generation Languages (3GLs) like C,
JAVA , C++ and Fourth-Generation Languages (4GLs) like .NET etc.
A high-level language program in C language to find the sum of two numbers:#include<stdio.h>
void main()
{
int a, b,sum;
printf("Enter Two Numbers:");
scanf("%d%d",&a,&b);
sum=a+b;
printf("Sum of %d and %d is %d",a,b,sum);
}

ME14 302 Computer Programming in C Uday Babu P Vidya Academy of Science and Technology. 2

Advantages
1. It is easier to develop programs in High-Level Languages compared to machine
language and assembly language.
2. It is easier to debug and understand High-Level Language Programs compared to
machine language programs and assembly language programs.
3. High level languages are machine independent. Programs developed in high level
languages are portable. Compiler will translate a high level language program into the
machine code of the respective microprocessor.
4. High-level language is easier to learn and use.
Disadvantages
1. Programs developed in High-Level Languages are not hardware efficient. The
execution time of a Program in High-Level Language is higher compared to a program
in machine Language and assembly language.
2. Programs developed in High-Level Languages cannot be executed by the
microprocessor directly. They need to be translated into machine code of the
corresponding microprocessor with the help of a compiler.
3. High-level Language programs require more memory.

ME14 302 Computer Programming in C Uday Babu P Vidya Academy of Science and Technology. 3

Das könnte Ihnen auch gefallen