Compiler, Interpreter, Assambler, and Linker


                A computer program or often abbreviated as a program is a series of instructions written to perform a specific function on a computer.
                Usually we write a computer program using high-level language. High level languages ​​are languages ​​that we humans can understand. It contains words and expressions from English or other languages.
                But computers don't understand high-level languages. Computers only understand programs written in numbers 0 and 1 in binary, which are called machine codes. A program written in a high level language is called source code. We need to change the source code to machine code and this is done by the translator.
Compiler is a computer program that is useful for translating computer programs written in certain programming languages ​​into programs written in other programming languages.
               Apart from its broad understanding, the term compiler is commonly used for computer programs that translate programs written in high-level programming languages ​​(such as Pascal, C ++, BASIC, FORTRAN, Visual Basic, Visual C #, Java, xBase, or COBOL) into machine language , usually with Assembly language as an intermediary.
               Modern compiler architecture is usually no longer a single program but a series of communication between programs with their specific tasks. These programs and their duties generally consist of:
• The compiler itself, which accepts source code and produces low-level language (assembly)
• Assembler, which accepts compiler output and generates object files in machine language
• Linker, which receives an assembler output object file and then joins it with the necessary libraries and produces an executable program
               Compilers that use this architecture for example GCC, Clang and FreeBASIC.
Some compilers do not use the above architecture explicitly, because communication between programs is much slower than if communication is done internally in one program. So the compilers integrate the assembler and linker in the compiler. However, usually the architecture used is not rigid and allows the use of assemblers or external linkers (useful if internal assemblers and linkers have problems). One of the compilers using this architecture is Free Pascal.
               In computer science, translators or better known as interpreters are software that functions to execute a number of instructions written in a programming language without first arranging them into machine programs language. Interpreters generally use one of the following strategies to run the program:
1. Execute the source code directly, or
2. Translate it into a series of p-codes then execute it, or
3. Execute code that was compiled previously by the compiler which is part of the translation system.
               This process is very different from the compiler, where in the compiler, the results are already in the form of a single command in the form of machine language, where the translation process is carried out before the program is executed.
Perl, Python, Ruby, and MATLAB are some examples of type 2 translator software, while Java is included in the type 3 category, but in some cases Java can also be classified into type 2 categories.
               Interpreter is software that is able to execute program code (written by the programmer) and then translate it into machine language, so that the machine carries out the instructions requested by the programmer. The commands made by the programmer are executed line by line, while following the logic contained in the code.
This process is very different from the compiler, where in the compiler, the results are already in the form of a single command in the form of machine language, where the translation process is carried out before the program is executed.
               Interpreter or known in Indonesian as Interpreter is different from Translator or translator in terms of the media used to translate. The interpreter will translate the source language into the target language directly orally while the translator will translate the source language into the target language in writing.
               Java is run using an interpreter, the Java Virtual Machine (JVM). This causes the Java source code that has been compiled into Java bytecodes can be run on different platforms.
               Assembly language is a program consisting of instructions that replace the binary codes of machine language with "mnemonics" that are easy to remember. For example an additional instruction in machine language with the code "10110011" which in assembly language can be made in the ADD mnemonic instruction, so it is easy to remember compared to the numbers 0 and 1, in each instruction requires an operand in the form of both direct data and a memory location that stores data concerned. Assembly language is often also called source code or symbolic code that cannot be executed by the processor, machine language is a collection of binary code which is instructions that can be run by a computer. Machine language programs are often referred to as object codes. Assembly language exists between high-level languages ​​and machine languages. This is closer to machine language than high level language. This is also called low level language. This language is not easy to read and understand by programmers like high-level programming languages. Assembler works as a translator in turning assembly language programs into machine code.
               Linker is a program that translates the object program (OBJ extension) to the form of an executable program (EXE or COM extension). Linker is used to unite the program module with other modules, so that it becomes an executable (for example the linked module is pthread). Whereas Linker is a program that can change Object files to COM or EXE files. Linker program can convert object files in the form of relocatable object code in the form of machine language which relatively needs to be fixed and adjusted to DOS rules. The Linker service program on Turbo Assembler is TLINK.EXE
The use of the TLINK.EXE linker generates files with file names with the COM or EXE extension, which consist of machine language codes that have been fixed so that they can be stored in memory (RAM) to carry out the program. All assembly processes and all link processes must have no errors, meaning the error must be 0. If there is still an error the program must be edited by opening the source program (.ASM file). To run a file that has been linked with TLINK.EXE, it can be directly executed by typing the file name in front of the DOS prompt or run through Windows
               Each language has a translator that is used as a liaison between programmers and machine language. This is because machine language is only understood by machines while programmers need their own language that they can understand. After the programmer finishes compiling the program he is making, the translator will translate it into machine language. So that the program that has been made can be run by electronic devices in the program earlier.
0/5 (0 Reviews)


Please enter your comment!
Please enter your name here