Monday, April 30

Computer Languages

An artificial language designed to convey instruction to a computer is known as a  computer language. The computer language may be low-level language or high level language.

High-level Language and Low-level Language
A language in which each statement is directly translated into a single machine code is known as low-level language.Assembly language is an example of such low-level language. The low-level language has some demerits. The programmer should know the structure of the computer (architecture, instructions etc.) in which we want to do programming. The problems of low-level language are solved to some extent by the language known as high-level language. It is a problem oriented and machine independent language.The programmer who writes programs in a high-level language does not need the detail of the architecture of his computer.

Machine Language
A computer uses binary digits for its operations and understands the information composed of zeros and ones. All the instructions given to the computer. are coded and stored in its memory in the form of zeros and ones.The language in which a computer works is called a machine language . A program written in the form of 0s  and 1s is called machine language program. In machine language each instruction has its own binary code. Such binary code (or machine code or object code ) written for an operation differs from computer to computer. It is very difficult to write a program in machine codes, and there is a lot of chances to commit mistakes while writing such programs.
Demerits of Machine language programs :
1. Programs written in machine language are very difficult and tedious.
2. Programs become very long.
3. Chances of  errors are more in writing programs.
4.  Debugging of program is very difficult.
5.  The entry of program is very slow.  
Examples of machine language program (using Intel 8085 Micro processor) :
To add two numbers placed in register A and register B the binary code is 10000000.

Assembly language
As we have seen in the previous section writing of program in machine language is very difficult. So, attempts had been made to introduce easily understandable language.One of such languages is assembly language.
A program written in mnemonics is known as assembly language program. The meaningful and easily remember-able alpha numeric symbols are called mnemonics.
Examples of few mnemonics are :
Mnemonics                 Purpose
Add                           Addition
Sub                            Subtraction
The use of mnemonics in assembly language  makes the writing of program easier and faster. Whenever a program is written in assembly language, it has to be translated into machine language before it is executed. The translation of assembly language is done with the help of a program, known as an assembler.

Advantages of Assembly language compared to Machine language are :
1. The results are obtained fast.
2. Computation time is less.
3. Writing of program is much easier and faster. 


Disadvantages of Assembly language compared to High-level languages are :
1. The assembly language programs are not portable (i.e. program written for one microcomputer does not work for next microcomputer.
2. Writing programs is difficult.
3. The program written in Assembly language are comparatively longer.
4. Assembly language is a computer oriented language (i.e. detail knowledge of microcomputer is required to write programs)

No comments:

Post a Comment