Difference between Compiler and Assembler

Computer ProgrammingAssembly ProgrammingProgramming


Compiler is used to translate an high level programming language code to machine level code and to create an executable program. Compiler checks the error in the program and reports them. All errors are to be removed otherwise code will not be compiled and executed.


Assembler is used to translate an assembly level code to machine readable code. Assembler too checks the correctness of each instruction and reports the diagnosis report.

Following are the important difference between Compiler and Assembler.

Sr. No.KeyCompilerAssembler
1OperationCompiler translates high level programming language code to machine level code.Assembler converts the assembly level language to machine level code.
2InputSource code in high level programming language.Assembly level code as input.
3Conversion typeCompiler checks and converts the complete code at one time.Assembler generally does not convert complete code at one time.
4Componentslexical analyzer, Syntax analyzer, Semantic analyzer, Code optimizer, Code generator, and Error handlerAssembler does works in two passes.
5OutputMnemonic version of machine code.Binary version of machine code.
6ExamplesC, C++ , Java compilers.GAS, GNU assemblers.
Published on 27-Nov-2019 07:46:54