GoConqr has a new look! Let us know what you think.

Mind map

The function and purpose of translators

BGL Computing A-Level English

Map content

The function and purpose of translators

  1. Why use translators?

    • Converts from source code
      • ...to object (machine) code
    • Detect errors in source code
  2. 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
  3. 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
    • Compiler
      • Translates whole program together
      • Creates an executable (or intermediate) program
      • Errors may be reported at the same time
      • Optimises code
  4. Intermediate Code

    • Partly translated code
      • ...that is portable
        • ...by using an interpreter (virtual machine)
          • (Theoretical computer on which intermediate code can run)
    • Problems
      • Runs slower than executable code
        • (Requires translation upon every run)
  5. 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
  6. 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
  7. Code Generation

    • Code converted into machine code
      • This code is optimised
        • ...increasing effeciency
        • ...reducing number of instructions
  8. Library Routines

    • What are they?
      • Pieces of software
        • ...that perform common tasks
    • 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

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

Feedback

What is it about?

What do you think of the new look?

How do you like it?