What is Assembler in Computer?
Assembler is a type of programming language translator. It is used to convert assembly language code into machine code or the code which is executable in computer. Basically, assembly language is a low-level programming language which is specific to a particular computer architecture.
The source program is an input of an assembler which contains assembly language instructions. And the output which is generated by assembler is the machine code or the object code which is understandable by the computer. An Assembler is the first interface which is able to communicate humans with machine.
What is Compiler in Computer?
It is a language process that reads the complete source code which is written in high-level language as a whole in one go and translate it into the machine language is called a compiler. And a compiler translates the source code to object code successfully if it is error free. And example of high-level language are C, C++, C#.
What is Interpreter in Computer?
An Interpreter translates the source program into machine code line by line. It executes next line after the translation of previous line. And if there is any error in the statement then interpreter terminates the translation process and show an error message. And it will move on to the next line after all the removal of the error in previous statements. And an interpreter translates one line at a time and then executes the translated line or statement. And Examples of interpreted languages are Python, Perl and Matlab.
Difference between Compiler, Interpreter and Assembler with Example
Compiler |
Interpreter |
Assembler |
Compiler translates entire program as a whole into machine code in one go. |
Interpreter translates the source program into machine code line by line. |
Assembler convert assembly code into machine code. |
In compiler debugging is easy. |
In interpreter debugging is easy because it reads the code line by line. |
Debugging is difficult compared to the compiler. |
Compiler is more intelligent than assembler. |
The codes interpreted by an interpreter runs slower than a compiler. |
The assembler is less intelligent compared to compiler. |
Compiler generates output in the form of .exe |
Interpreter does not generate any output. |
Assembler translates the assembly language code into machine code which can be executed by a computer's CPU. |
Examples are C, C++, C# |
Examples are Python, Perl, JavaScript |
Examples are x86, MIPS and ARM. |