1.5.4 Translator Software
1.5.4 Translator Software
Assembler
An assembler translates assembly language into machine code. Assembly language consists of
0T 0T 0T 0T
mnemonics for machine opcodes so assemblers perform a 1:1 ratio translation from mnemonic to a
direct instruction. For example:
Conversely, one instruction in a high level language will translate to one or more instructions at machine
level.
language, object/machine code. The most common reason for translating source code is to create an
executable program (converting from a high level language into machine language).
Interpreter
35T
An interpreter program executes other programs directly, running through program code and executing it
line-by-line. As it analyses every line, an interpreter is slower than running compiled code but it can take
less time to interpret program code than to compile and then run it — this is very useful when prototyping
and testing code. Interpreters are written for multiple platforms, this means code written once can be run
immediately on different systems without having to recompile for each. Examples of this include flash
based web programs that will run on your PC, MAC, games console and Mobile phone.
The Java Virtual Machine takes the byte code prepared by the Java compiler and executes it. The byte-code itself is
platform-independent; it is the responsibility of the Java Virtual Machine implementation to execute the program in
the byte-code form on the real computer.
So, the java code is partially compiled for optimization by the programmer. The user runs the code on a Java virtual
machine on their computers that interprets the java code for the users' computer specific architecture.