Skip to main content

DIFFERENCE BETWEEN COMPILER, INTERPRETER AND ASSEMBLER

ventional computers, translation of the program or the source code into object/machine code is done by various methods which include assembler, compiler and interpreter. Below are the underlying details of how they differ from one another.

 What You Need To Know About Assembler

An assembler is a program that takes basic computer instruction or instructions and then converts them into a pattern of bits that the computer processor can use to perform its basic operations. Usually, language used to program the assembler is referred to as assembly language. Assembler converts source code to an object code first then it converts the object code to machine language with the help of the linker programs.

                                         OR


ASSEMBLER

An assembler is a program that converts assembly language into machine code. It takes the basic commands and operations from assembly code and converts them into binary code that can be recognized by a specific type of processorcode.

Function: The main function of an assembler is that converts assembly level code into machine level code.

Details About Assembler

  1. Assembler converts source code written in assembly language into machine code and then that machine code is executed by a computer.
  2. Assembler converts assembly language to machine language at once.
  3. It converts a source code to an object first then it converts the object code to machine language with the linker programs.
  4. Input to the assembler is assembly language code.
  5. GAS, GNU is an example of an assembler.
  6. At the output of assembler is re-locatable machine code generated by an assembler is represented by binary code.
  7. Assembler cannot convert the whole code into machine language at once.
  8. Assembler is less intelligent than compiler.
  9. Assembler makes two phases over the given input first phase and the second phase.
  10. It is difficult to debugging.

What is Compiler

A compiler is a language translator that converts high level programs into machine understandable machine codes. In this process, the compiler converts the whole program to machine code at a time. If there are any syntactic or semantic error, the compiler will indicate them. It checks the whole program and displays all errors. It is not possible to execute the program without fixing those errors.

                                OR

A compiler is a computer program that transforms source code written in programming language into machine language and then executes it.  Normally, Compilers can take time because they have to translate high-level code to lower-level machine language at once and then save the executable object code to the memory. Also in a compiler, after conversion of all the code at once an error report for the whole program is generated.

Compilers can be classified based on what function it performs or how it has been constructed. Compilers can be classified as single-pass, load-and-go, debugging, multi-pass and optimization.

Compilation is performed in the following phases: lexical analyzer, syntax analyzer, semantic analyzer, intermediate code generator, code optimizer, symbol table and error handle.

Details About Compiler

  1. A compiler converts high-level language program code into machine language and then executes it. High-level languages are C and C#
  2. Complier scans the entire program first before translating into machine code.
  3. Compiler takes entire program as input.
  4. Intermediate object code is generated in case of compiler.
  5. Compiler takes less execution time when compared to interpreter.

Interpreter

Interpreter is a computer program that translates high level instructions into an intermediate form and then converts that intermediate code into machine language and; carries out specific actions. Interpreters are often used in software development tools as debugging tools because they can execute a single code at a time. 

Details About Interpreter

  1. Interpreter converts source code into the intermediate form and then converts that intermediate code into machine language. The intermediate code looks same as assembler code.
  2. Interpreter scans and translates the program line by line to equivalent machine code.
  3. Interpreter takes single instruction as input.
  4. In case of interpreter, No intermediate object code is generated.
  5. Interpreter takes more execution time when compared to cocompiler.

Comments

  1. Amazing write up , informative and knowledgeable stuff with great quality content. Thank you for sharing such informative content.
    Bachelor of Architecture Jobs and Career

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular posts from this blog

BCA- Computer Fundamental Old Question Paper

BCA 1ST SEMESTER NOTES

JAVA