What is the function of translation programs?
The translation program converts the high level source code into low level assembly language (or machine code) ready for execution.
What is the purpose of an assembler?
An assembler converts code written in assembly language into object code (machine code or binary) ready for execution by the computer.
What is the difference between a compiler and an interpreter?
A compiler compiles all the code in one go by converting it from high level language to a file object code before executing. (Use for publishing and all-round)
An interpreter converts each line of code into machine code one at a time before executing it. After one line has been converted, the next line can be translated. (Usually used for debugging and testing)
What are the 4 stages of compilation?
What happens during lexical analysis?
What happens during syntax analysis?
What happens during semantic analysis?
What happens during code generation?
- Code optimisation may take place
What is a subprogram library?
This is a library which contains subprograms and subroutines. The main program can then call these subroutines from the library by importing (linking) the library.
What is a link loader?
This is a piece of software which can load parts of programs stored in different locations and link them together.
Name and describe two translation errors
Syntax error - Where code has been written outside the grammar of the language
Run-time error - e.g Trying to divide by 0 when the program is running