44 total
By the end of this subtopic, you should be able to:
understand why an assembler is needed to translate an assembly language program
understand why a compiler is needed to translate a high-level language program
understand why an interpreter is needed to translate and execute a high-level language program
explain the benefits and drawbacks of using a compiler
explain the benefits and drawbacks of using an interpreter
justify when it is better to use a compiler and when it is better to use an interpreter
understand that some high-level language programs are partly compiled and partly interpreted, such as Java
describe the features of a typical Integrated Development Environment (IDE), including:
A computer processor can only run instructions in machine code. Machine code is made of binary patterns that the processor can understand directly. Humans do not normally write large programs in machine code because it is very hard to read, write, and fix.
Instead, programmers usually write code in either:
Because the processor cannot directly understand assembly language or most high-level languages, a translator is needed. A translator is a program that changes source code into a form that can be run.
There are three translators you need to know in this topic:
Each one has a different job.
An assembler is used for an assembly language program.
Assembly language is a low-level language. This means it is close to machine code, but it still uses words or abbreviations that humans can remember more easily, such as instruction mnemonics. The processor cannot run these mnemonics directly, so the assembly code must be translated into machine code first.
The assembler does this translation.
A simple way to think about it is this:
So, the need for an assembler is clear: without it, the assembly language program could not be turned into machine code for the processor to run.
Assembly language is useful when very close control of hardware is needed, but it is harder to write than a high-level language. That is one reason why assemblers are important. They let programmers write in a slightly more human-friendly low-level form instead of writing raw machine code.
Sign in to view full notes