Translators
1.Assembler.
2.Compiler.
3.Interpreter.
1.Assembler:
Our computer understands only binary language(machine language).To translate assembly language program into machine language we required a program.An assembler a program that takes basic computer instructions and converts then into a pattern of bits(machine language) that the computer's processor can use to perform its basic operations.
2.Compiler
It is a program translator that translates the instruction of a higher level language to machine language.it is called compiler because it compiles machine language instructions for every program instructions of higher level language.Thus compiler is a program translator like assembler but more sophisticated.It scans the entire program first and then translates it into machine code.
The program written by the programmer in higher level language is called source program.After this program is converted to machine language by the compiler it is called object program.A compiler can translate only those source programs,which have been written,in the language for which the compiler is meant for.For example FORTRAN compiler will not compile sorce code written in COBOL language.
Object program generated by compiler is machine dependent.It means programs compiled for one type of machine will not run in another type.Therefore every type of machine must have its personal compiler for a particular language.Machine independence is achieved by using only higher level language in different machines.
3.Interpreter:
An interpreter is another type of program translator used for translating higher level language into machine language.It takes one statement of higher level language,translate it into machine language and immediately execute it.Translation and execution are carried out for which statement.It differs from compiler,which translate the entire source program into machine code and does involve in its execution.
The advantage of interpreter compared to compiler is its fast response to changes in source program.It eliminates the need for a separate compilation after changes to each program.Interpreters are easy to write and do not require large memory in computer.The disadvantage of interpreter is that it is time consuming method because each time a statement in a program is executed then it is first translated.Thus compiled machine language program runs much faster than an interpreted program.
what is translators
translators
0 Comments