Explain overview of translation process.
- A translator is a kind of program that takes one form of program as input and converts it into another form.
- The input is called source program and output is called target program.
- The source language can be assembly language or higher level language like C, C++, FORTRAN, etc...
- There are three types of translators,
- Compiler
- Interpreter
- Assembler
Write the difference between compiler, interpreter and assembler.
1. Compiler v/s Interpreter
No. | Compiler | Interpreter |
---|---|---|
1 | Compiler takes entire program as an input. | Interpreter takes single instruction as an input. |
2 | Intermediate code is generated. | No Intermediate code is generated. |
3 | Memory requirement is more. | Memory requirement is less. |
4 | Error is displayed after entire program is checked. | Error is displayed for every instruction interpreted. |
5 | Example: C compiler | Example: BASIC |
2. Compiler v/s Assembler
No. | Compiler | Assembler |
---|---|---|
1 | It translates higher level language to machine code. | It translates mnemonic operation code to machine code. |
2 | Types of compiler, • Single pass compiler • Multi pass compiler | Types of assembler, • Single pass assembler • Two pass assembler |
3 | Example: C compiler | Example: 8085, 8086 instruction set |