0% found this document useful (0 votes)
3 views

POP Unit 3 Assembler_Compiler_Interpreter

Uploaded by

Sks Yt
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

POP Unit 3 Assembler_Compiler_Interpreter

Uploaded by

Sks Yt
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Language Translator

Translator is a program/software which converts


code/instruction from one language to another language.
Different types of translators:
1. Assembler
2. Compiler
3. Interpreter

Assembler
An assembler is a special type of software that
converts assembly language code into machine code
which is easily understandable by computer to
execute.

Note: This machine code is what the processor


actually executes to perform the operations you’ve
described in assembly language.

Compiler
A compiler is a special software that translates
high-level programming language code (like C++ or
Java) into machine code, which is the binary code
(0s and 1s).

- Compiler translate whole program then execute.


- Compiler shows all errors and warning at once.
- Compiler translate code only once and run many
no. of times; because it gives an object code
after compilation of whole program.

- Executable file is a collection of object code


or object file.

Interpreter
- interpreter is a translator which translates
and executes instructions line by line.
- when there is syntax error in one line, the
translation is stopped and rest of the
statements are not translated.
- It immediately translates each line into
machine code and executes it before moving on
to the next line.
- interpreter required to translate every time
before execution because interpreter
doesn't store translated code.
- It doesn’t provide object code.
Object Code vs Machine Code
1. Execution
Machine code can be executed directly by the
CPU, while object code usually needs to be
linked before it can be executed.

2. Format
Machine code is binary code, while object code
is usually packaged in an executable format.

Task:
1. Difference b/w Compiler and Interpreter.

You might also like