Home » Interpreter, Compiler and Assembler

Interpreter, Compiler and Assembler

Interpreter 

Interpreter converts source code written in High level Language into machine code line by line and then created executable file.

An interpreter may be a program that either

  1. executes the source code directly.
  2. translates source code into some efficient intermediate representation or code and immediately executes this.
  3. explicitly executes stored pre-compiled code made by a compiler which is a part of the interpreter system.

A program that executes instructions written in a High-level language. An interpreter translates High level instruction into an intermediate form, which it then executes.

Advantages of Interpreter:

  1. Interpreters are useful for program development when execution speed is not important. As the interpreter is in command of the execution process debugging features can be build in.
  2. Debugging is easier since the interpreter stops when it encounters an error. Is an error is  deducted there is no need to re translate the whole program.
  3. There is no lengthy “compile time”, i.e. you do not have to wait between written a program and running it, for it to compile. As soon as you have written a program, you can run it.

Disadvantages of Interpreter:

  1. Interpreters normally translate and execute programs line by line, converting each program statement into a sequence of machine code instructions and executing these instructions without retaining the translated version.
  2. No object code is produced, so a translation has to be done every time the program is running. Source code is required for the program to be executed.

Compiler

A compiler is a computer program that translates source code or program written in High level Language into machine code and created an executable file. The original sequence is usually called the source code and the output called object code. Commonly the output has a form suitable for processing by other programs, but it may be human readable text file.

Assembler

A utility program called an assembler is used to translate assembly language statements into the target computer’s machine code. The assembler performs a more or less isomorphic translation from mnemonic statements into machine instructions and data.

Advantages of Assembler:

  1. Programs written in machine language are replaced by mnemonics which are easier to remember.
  2. Easy to make insertions and deletions.
  3. It is not required to keep track of memory locations.
  4. Requires fewer instructions to accomplish the same result.

Disadvantages of Assembler:

  1. Programs written in such language cannot be executed on small sized computers.
  2.  Ii takes lot of time to code or write the program, as it more complex in nature.
  3.  Lack pf portability of program between computers of different  makes.

1 Comment

  1. Everүthing is very open wіth a very ⅽⅼear clarification of the challengeѕ.

    It waѕ really informative. Youг website is very helpful.

    Thanks for ѕharing!

Leave a comment

Your email address will not be published. Required fields are marked *

‘C’ Practical

  1. To get fomiliar with the structure of a ‘C’ program and print “Hello World!” on computer screen.
  2. To perform addition, subtraction, multiplication and division operations on two integers.
  3. To use unformatted 1/0 functions (getchar() and putchar(), gets() and puts()).
  4. To use scanf() function to read integers (%d, %i, %o, %u, %x), characters (%c), floating point numbers (%f, %g, %e), strings (%s, scanset).
  5. To use printf() function to format and print output (%d, %i, %o, %u, %x, %e, %E, %f, %g, %c, %p, %c, %s, %n)
  6. To change width, precision and alignment of the output of printf().
  7. To perform and, or, not, exor, left-shift and right-shift operations on integers.
  8. To check whether a given integer is even or odd (if … else statement).
  9. To write month name corresponding to a month number (switch … case).
  10. To check whether a given integer is prime using while loop.
  11. To reverse the digits of a given positive integer using while loop.
  12. To generate the multiplication table of a given integer using for loop.
  13. To generate first n terms of Fibonacci series using do-while loop.
  14. To compute factorial of a given integer using for loop.
  15. To compute sum of elements of a one dimensional integer array.
  16. To find the largest element in a one dimensional array.
  17. To perform matrix addition and matrix multiplication using 2-D arrays.
  18. To convert the alphabetic characters of a string to uppercase.
  19. To find the length of a string.
  20. To use Standard Library String Functions (strcat(), strrev(), strcp(), strcmp())
  21. Writing a function to find sum of two integers.
  22. Writing a function to swap value of two integers (call by reference).
  23. Writing a function to compute factorial of a given integer (using recursion).
  24. To read and print multiple data items (roll_no, name, branch, semester etc.) pertaining to an individual student.
  25. Demonstrating the use of union
  26. Demonstrating the use of address and dereferencing operators
  27. Performing pointer arithmetic to manipulate an array
  28. To read the contents from a file and display it on screen
  29. To read names and addresss of persons and write them into a file.
  30. Write a program to read the contents of two different files and write it into the third file.