Mind map
The function and purpose of translators
Map content
The function and purpose of translators
Why use translators?
- Converts from source code
- ...to object (machine) code
- Detect errors in source code
- Converts from source code
Assembly Language
- What is it?
- A Low level language/Not portable
- Uses mnemonics
- Each instruction translated into one machine code instruction
- Uses descriptive names (for data stores)
- Tasks performed
- Reserves storage for instructions and data
- Replaces mnemonic opcodes by machine codes
- Replaces symbolic addresses by numeric addresses
- Symbol table created to match labels to addresses
- Checks syntax
- Machine Code
- Binary notation
- Set of all instructions available
- ...specifically to processor architecture
- Instructions operate on bytes of data
- What is it?
Interpretation & Compilation
- Interpreter
- Translates one line
- ...running the line before translation of next line
- Errors reported one at a time as checked line by line
- Translates one line
- Compiler
- Translates whole program together
- Creates an executable (or intermediate) program
- Errors may be reported at the same time
- Optimises code
- Interpreter
Intermediate Code
- Partly translated code
- ...that is portable
- ...by using an interpreter (virtual machine)
- (Theoretical computer on which intermediate code can run)
- ...by using an interpreter (virtual machine)
- ...that is portable
- Problems
- Runs slower than executable code
- (Requires translation upon every run)
- Runs slower than executable code
- Partly translated code
Lexical Analysis
- Source code used as input
- Tokens created from individual symbols in code
- ...and reserved words
- Token is a fixed length of binary digits
- Variable names loaded into symbol table
- Redundant characters removed
- Comments removed
- Error diagnostics given
- Prepares code for syntax analysis
- Error diagnostics given
- Comments removed
- Redundant characters removed
- Tokens created from individual symbols in code
- Source code used as input
Syntax Analysis
- Takes output from lexical analysis
- statements/tokens checked
- ...against rules of language
- Errors reported as a list
- Diagnostics may be given
- Code is passed to code generation
- ...further detail added to symbol table
- statements/tokens checked
- Takes output from lexical analysis
Code Generation
- Code converted into machine code
- This code is optimised
- ...increasing effeciency
- ...reducing number of instructions
- This code is optimised
- Code converted into machine code
Library Routines
- What are they?
- Pieces of software
- ...that perform common tasks
- Pieces of software
- How do they help?
- Error-free (tested) code
- Already written (saves time)
- Can be used multiple times
- Programmer can use others' expertise
- How are they used?
- Linker used
- ...to link routine with program
- Loader used
- ...to handle addresses
- ...when program runs
- Linker used
- What are they?
Information
- Description
- A-Level Computing Mind Map on The function and purpose of translators, created by BGL on 04/04/2016.
- Created by
- BGL
- Views
- 0
- Rating