• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Compilation
 

Compilation

on

  • 834 views

This covers details of the processes of compilation. A lot of extra teaching support is required with these.

This covers details of the processes of compilation. A lot of extra teaching support is required with these.
Originally written for AQA A level Computing (UK exam).

Statistics

Views

Total Views
834
Views on SlideShare
832
Embed Views
2

Actions

Likes
0
Downloads
14
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Compilation Compilation Presentation Transcript

    • Compilation From code to executable By David Halliday
    • Stages from Source to Executable
      • Compilation:
        • source code ==> relocatable object code (binaries)
      • Linking:
        • many relocatable binaries (modules plus libraries) ==> one relocatable binary (with all external references satisfied)
      • Loading:
        • relocatable ==> absolute binary (with all code and data references bound to the addresses occupied in memory)
      • Execution:
        • control is transferred to the first instruction of the program
    • Phases of the Compilation Process 1
      • Lexical analysis (scanning):
        • the source text is broken into tokens.
      • Syntactic analysis (parsing):
        • tokens are combined to form syntactic structures, typically represented by a parse tree.
        • The parser may be replaced by a syntax-directed editor, which directly generates a parse tree as a product of editing.
      • Semantic analysis:
        • intermediate code is generated for each syntactic structure.
        • Type checking is performed in this phase.
    • Phases of the Compilation Process 2
      • Machine-independent optimization:
        • intermediate code is optimized to improve efficiency.
      • Code generation:
        • intermediate code is translated to relocatable object code for the target machine.
      • Machine-dependent optimization:
        • the machine code is optimized.
        • On some systems (e.g., C under Unix), the compiler produces assembly code, which is then translated by an assembler.