L18 - CS61C Machine Structures Lecture 18 - Running a...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 61C L18 Running a Program (1) Wawrzynek Fall 2007 © UCB 10/8/2007 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS61C – Machine Structures Lecture 18 - Running a Program I aka Compiling, Assembling, Linking, Loading CS 61C L18 Running a Program (2) Wawrzynek Fall 2007 © UCB Overview ° Interpretation vs Translation ° Translating C Programs C ompiler A ssembler L inker (next time) L oader (next time) ° An Example (next time)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 61C L18 Running a Program (3) Wawrzynek Fall 2007 © UCB Language Execution Continuum ° Language translation gives us another option. ° In general, we interpret a high level language when efficiency is not critical and translate to a lower level language to improve performance Easy to program Inefficient to interpret Efficient to interpret Difficult to program Scheme Java C++ C Assembly machine language Java bytecode ° An Interpreter is a program that executes other programs. CS 61C L18 Running a Program (4) Wawrzynek Fall 2007 © UCB Interpretation vs Translation ° How do we run a program written in a source language? ° Interpreter: Directly executes a program in the source language ° Translator: Converts a program from the source language to an equivalent program in another language ° For example, consider a Scheme program foo.scm
Background image of page 2
CS 61C L18 Running a Program (5) Wawrzynek Fall 2007 © UCB Interpretation Scheme program: foo.scm Scheme Interpreter ° Scheme Interpreter is just a program that reads a scheme program and performs the functions of that scheme program. CS 61C L18 Running a Program (6) Wawrzynek Fall 2007 © UCB Translation Scheme program: foo.scm Hardware Scheme Compiler Executable(mach lang pgm): a.out ° Scheme Compiler is a translator from Scheme to machine language. ° The processor is a hardware interpeter of machine language.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 61C L18 Running a Program (7) Wawrzynek Fall 2007 © UCB Machine Language Interpretation ° Any good reason to interpret machine language in software? °
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/09/2008 for the course CS 61A taught by Professor Harvey during the Spring '08 term at University of California, Berkeley.

Page1 / 12

L18 - CS61C Machine Structures Lecture 18 - Running a...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online