You are on page 1of 2

Machine code is the only form of program instructions that the computer hardware can understand and

execute directly. All other forms of computer language must be translated into machine code in order to be
executed by the hardware. Machine code consists of many strings of binary digits that are easy for the
computer to interpret, but tedious for human beings to interpret. Machine code is different for each type of
computer. A program in machine code for an Intel x86-based PC will not run on an IBM mainframe
computer, and vice versa.
Assembly language is a symbolic representation of machine code, which allows programmers to write
programs in machine code without having to deal with the long binary strings. For example, the machine
code for an instruction that adds two numbers might be 01101110, but in assembly language, this can be
represented by the symbol ADD. A simple assembler program translates this symbolic language directly
into machine code. Because machine code is specific to each type of computer hardware, assembly
languages are also specific to each type of computer. However, all machine languages and assembly
languages look very similar, even though they are not interchangeable.
High-level language is a language that is convenient for human beings to understand. High-level
programming languages must be translated into machine code for execution, and this process is called
compilation. A program that carries out this translation is a compiler. High-level language may bear no
resemblance at all to machine code. The compiler figures out how to generate machine language that
does exactly what the high-level-language source program specifies. Languages like C++, Algol, COBOL,
etc., are all compiled high-level languages. They usually work more or less the same across all computer
types, which makes them much more portable than assembly language.
Some high-level languages are interpreted rather than compiled. This means that they are not translated
into machine code. Instead, when the program is executed, another program, called an interpreter, looks
at the source code and does what it says, without actually translating it into machine language. Visual
Basic, Java, Javascript, BASIC, and many other languages work this way. It's more flexible, but it is far
slower than a compiled language.

It is difficult to write and maintain programs in machine level language. The programs
written in the code of high level language and low level language need to be converted into
machine level language using translators for this purpose.
Translators are just computer programs which accept a program written in high level or low
level language and produce an equivalent machine level program as output. Translators are
of three types:

Assembler

Compiler

Interpreter

Assembler is used for converting the code of low level language (assembly language) into
machine level language.
Compilers and interpreters are used to convert the code of high level language into machine
language.The high level program is known as source program and the corresponding
machine level program is known as object program. Although both compilers and
interpreters perform the same task but there is a difference in their working.
A compiler searches all the errors of a program and lists them. If the program is error free
then it converts the code of program into machine code and then the program can be
executed by separate commands.
An interpreter checks the errors of a program statement by statement. After checking one
statement, it converts that statement into machine code and then executes that statement.
The process continues until the last statement of program occurs.

You might also like