Contact us

Header Ads

Define translator in computer and Concept of assembler, compiler, interpreter, linker, loader

               What is translator in computer?

In previous post, we have already studied about Computer Languages and It's ClassificationNow we are going further.... 

                       TRANSLATORS 

  A computer(pc) will not understand any program written in a language, other than its machine language. The programs written in other languages must be translated into the machine language(binary language). Such translation is performed with the help of software called translator

Assembler:- 

• A program which translates an programming language program into a machine language program is named an assembler. If an assembler which runs on a computer and produces the machine codes for an equivalent computer then it's called self assembler or resident assembler. If an assembler that runs on a computer and produces the machine codes for other computer then it's called Cross Assembler.
 • Assemblers are divided into two types: One Pass Assembler and Two Pass Assembler. One pass assembler is that the assembler which assigns the memory addresses to the variables and translates the ASCII text file into machine language within the first pass simultaneously. A Two Pass Assembler is that the assembler which reads the ASCII text file twice. In the first pass, it reads all the variables and assigns them memory addresses. In the second pass, it reads the ASCII text file and translates the code into code .
Translator
Assembler

 Compiler:-

 Compiler may be a computer program(s) that transforms ASCII text file written during a programing language into machine language that's the target language which usually features a binary form referred to as code . Compiler goes through the whole program then translates the whole program into machine codes and intelligently checks all types of limits, ranges, errors etc. and report if any.
Translator
Compiler

Interpreter:-

• An interpreter is a program which translates statements of a program into machine language(0's and 1's) . It translates just one statement of the program at a time. It reads just one statement of program, translates it and executes it. Then it reads subsequent statement of the program again translates it and executes it. In this way Interpreter proceeds further till all the statements are translated and executed. On the opposite hand, a compiler goes through the whole program then translates the whole program into machine codes. Compiler is faster than interpreter near about 5 to 25 times. 
• By the compiler, the machine codes(0's and 1's) are saved permanently for future reference. On the opposite hand, the machine codes produced by interpreter aren't saved. An interpreter may be a small program as compared to compiler. It occupies less memory space, so it are often utilized in a smaller system which has limited memory space.
Translator
Interpreter

Linker:- 

• In high level languages, some inbuilt header files or libraries are stored. These libraries are already defined and these contain basic functions which are essential for executing the program. These functions are linked to the predefined libraries by a program called Linker. If linker doesn't find a library of a function then it informs to compiler then compiler generates a mistake . The compiler automatically invokes the linker because the last step in compiling a program. 
• Not inbuilt libraries, it also links the user defined functions to the user defined libraries. Usually a extended program is split into smaller subprograms called modules. And these modules must be attached to execute the program. The process of mixing the modules is completed by the linker.

 Loader:- 

Loader may be a program that loads machine codes of a program into the system memory. In Computing, a loader is that the a part of an OS that's liable for loading programs. It is one among the essential stages within the process of starting a program. Because it places programs into memory and prepares them for execution in computer. Loading a program involves reading the contents of executable file into memory of computer. After loading is complete, the OS starts the program by passing control to the loaded program code. All operating systems(OS) that support program loading have loaders. In many operating systems(OS) the loader is permanently resident in memory.
Translator
Difference between Compiler and Interpreter

Execution process of a C program
Execution process of a C program

Classification of high level language
Classification of high level language


Post a Comment

1 Comments

If you like my content then share it...