Machine Language

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Machine Language:- A computer understands information composed of only zeros and ones

and hence, it used binary digits for its operation. The computer’s instructions are coded and
stored in the memory in the form of 0s and 1s. A program written in the form of 0s and 1s is
called machine language program. There is a specific binary code for each instruction. For
example, to add the contents of register A and register B, the binary code is 10000000 for Intel
8085. The binary code for a certain operation differs from microprocessor to microprocessor.

Assembly Language:- The writing of programs in machine language is very difficult,


tiresome and boring job for a programmer. Moreover it is error prone. To solve this problem and
to facilitate programmer easily understandable languages have been developed. Assembly
language is one of them. Programmer can easily be written in alphanumeric symbols instead of
0s and 1s. Meaningful and easily0 rememberable symbols are selected for this purpose. For
example, ADD for addition, SUB for subtraction, CMP for comparison etc. Such symbols are
known as mnemonics. A program written in mnemonics is called assembly language program.
The writing of programs is assembly language is easier and faster as compared to the writing of
programs in a machine language.

Low level and High-level languages-


A language in which each statement(instruction) is directly translated into a single machine code
is known as low-level language. Examples of the low-level language are machine language. The
basic problem of assembly language is that it is more closely related to the structure of a
computer than to the performance of the task which is to be performed. The programmer spends
more time in manipulating registers and considering instruction sequences than solving actual
problems. The programmer must have very detailed knowledge of the instruction set,
architecture and connection of peripheral s to the ports etc.
To overcome the difficulties associated with assembly languages high-level or procedure
oriented languages have been developed. High-level languages permit programmers to describe
tasks in a form which is problems oriented or object oriented rather than computer oriented. One
can formulate problems more efficiently in a high-level language and need not have a precise
knowledge of the architecture of the computer is using. Examples of high level languages are
BASIC, PASCAL, FORTRAN, COBOL, C,C++ etc.

Complier:- A program which translates a high-level language program into a machine


language program is called a compiler. A complier is more intelligent than an assembler. It
checks all kinds of limits, ranges, errors etc. But its program execution time is more, and
occupies a larger part of the memory. It has low speed and low efficiency of memory utilization.

Interpreter:- An interpreter is program which translates statements of a high-level language


program into machine codes. It translates one statement of the program at a time. It reads one
statement of a high-level language program, translates it into machine code and executes it.
Then it reads the next statement of the program, translate it and executes it. In this way it
proceeds further till all the statements of the program are translated and executed. On the other
hand a compiler goes through the entire high-level language program once or twice and then
translates the entire program into machine code. A compiler is 5 to 25 times faster than an
interpreter. An interpreter is a smaller program as compared to compiler.

You might also like