0% found this document useful (0 votes)
18 views3 pages

Compiler Assembler Interpreter

Language processors are essential for translating high-level programming languages into machine code, which computers can execute. There are three main types of language processors: compilers, assemblers, and interpreters, each with distinct functions and characteristics. Compilers translate the entire source code at once, assemblers convert assembly language to machine code, and interpreters execute code line by line, providing immediate feedback on errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Compiler Assembler Interpreter

Language processors are essential for translating high-level programming languages into machine code, which computers can execute. There are three main types of language processors: compilers, assemblers, and interpreters, each with distinct functions and characteristics. Compilers translate the entire source code at once, assemblers convert assembly language to machine code, and interpreters execute code line by line, providing immediate feedback on errors.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Language Processors: Assembler, Compiler and Interpreter

Language Processors –
Assembly language is machine dependent yet mnemonics that are being used to
represent instructions in it are not directly understandable by machine and high-
level language is machine independent. A computer understands instructions in
machine code, i.e. in the form of 0s and 1s. It is a tedious task to write a computer
program directly in machine code.

The programs are written mostly in high level languages like Java, C++, Python
etc. and are called source code. These source code cannot be executed directly
by the computer and must be converted into machine language to be executed.
Hence, a special translator system software is used to translate the program
written in high-level language into machine code is called Language
Processor and the program after translated into machine code (object program /
object code).

The language processors can be any of the following three types:


1. Compiler –
The language processor that reads the complete source program written in
high level language as a whole in one go and translates it into an equivalent
program in machine language is called as a Compiler.

Example: C, C++, C#, Java


In a compiler, the source code is translated to object code successfully if it
is free of errors. The compiler specifies the errors at the end of compilation
with line numbers when there are any errors in the source code. The errors
must be removed before the compiler can successfully recompile the source
code again.

2. Assembler –
The Assembler is used to translate the program written in Assembly
language into machine code. The source program is a input of assembler that
contains assembly language instructions. The output generated by assembler
is the object code or machine code understandable by the computer.

3. Interpreter –
The translation of single statement of source program into machine code is
done by language processor and executes it immediately before moving on
to the next line is called an interpreter. If there is an error in the statement,
the interpreter terminates its translating process at that statement and
displays an error message. The interpreter moves on to the next line for
execution only after removal of the error.

An Interpreter directly executes instructions written in a programming or


scripting language without previously converting them to an object code or
machine code.

Example: Python and Matlab.

Difference between Compiler and Interpreter –


COMPILER INTERPRETER

• A compiler is a program which coverts interpreter takes a source


the entire source code of a program and runs it line by line,
programming language into translating each line as it comes
executable machine code for a CPU. to it.

• Compiler takes large amount of time to Interpreter takes less amount of


analyze the entire source code but the time to analyze the source code
overall execution time of the program but the overall execution time of
is comparatively faster. the program is slower.

• Compiler generates the error message


only after scanning the whole program,
so debugging is comparatively hard as Its Debugging is easier as it
the error can be present any where in continues translating the
the program. program until the error is met
COMPILER INTERPRETER

No intermediate object code is


• Generates intermediate object code. generated.

• Examples: C, C++, Java Examples: Python, Perl

You might also like