Site icon zLog

Is it an Assembler or is it a Compiler!

Is it an Assembler or is it a Compiler or Is it an Interpreter or is it a linker!

Many of the “Software Engineers” I met said “assembler was a part of Computer Hardware”… !

Yes? No?

Actually, Assemblers are software, or in other words, a set of instructions that a computer uses to assemble code modules. These modules are said to run on “bare metal”, meaning they are “assembled” literally into machine instructions, instead of being “compiled” or “interpreted” into machine instructions. A program that translates programs from assembly language to machine language is assembler.

Any program that is not written in machine language has to be translated in machine language before it is executed by the computer. The means used for translation are themselves computer programs. There are three types of translator programs i.e. Assembler, Compilers and Interpreters.

At this point, I’d like to talk about Assembler, Compiler, Interpreter and Linker.

Assembler: Assembler is a computer program which is used to translate program written in Assembly Language in to machine language. The translated program is called as object program. Assembler checks each instruction for its correctness and generates diagnostic messages, if there are mistakes in the program. Various steps of assembling are:

Compiler: A compiler is a program that translates a program written in HLL to executable machine language. The process of transferring HKK source program in to object code is a lengthy and complex process as compared to assembling. Compliers have diagnostic capabilities and prompt the programmer with appropriate error message while compiling a HLL program. The corrections are to be incorporated in the program, whenever needed, and the program has to be recompiled. The process is repeated until the program is mistake free and translated to an object code. Thus the job of a complier includes the following:

Interpreter: The basic purpose of interpreter is same as that of compiler. In compiler, the program is translated completely and directly executable version is generated. Whereas interpreter translates each instruction, executes it and then the next instruction is translated and this goes on until end of the program. In this case, object code is not stored and reused. Every time the program is executed, the interpreter translates each instruction freshly. It also has program diagnostic capabilities. However, it has some disadvantages as below:

Linker: The task for the linker is to grab all object files and make one executable. It uses the object files generated by the compiler and the assembler tool together with some pre-generated libraries, where some standard functions are defined. Because of the linker, you can call from one C-file functions that are defined in an other one. The linker will search the object files for finding the references.

Exit mobile version