2008SpCS61C-L18-ddg-runprogI-6up

2008SpCS61C-L18-ddg-runprogI-6up - UCB CS61C : Machine...

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

View Full Document Right Arrow Icon
inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 18 – Running a Program I (Compiling, Assembling, Linking, Loading) 2008-03-04 Researchers at the University of Pittsburgh have used an atomic force microscope (AFM) to draw tiny, electrically conductive paths (ala wires) on a special material. The lines were as thin as 3 nm, making this one of the most precise techniques for etching devices out of silicon. Rewritable logic circuits? High-density memory? Very cool! Lecturer SOE Dan Garcia www.technologyreview.com/Nanotech/20362/ CS61C L18 Running a Program I (3) Garcia, Spring 2008 © UCB Disassembly is simple and starts by decoding opcode field. Be creative, efficient when authoring C Assembler expands real instruction set (TAL) with pseudoinstructions (MAL) Only TAL can be converted to raw binary Assembler’s job to do conversion Assembler uses reserved register $at MAL makes it much easier to write MIPS Review CS61C L18 Running a Program I (4) Garcia, Spring 2008 © UCB Interpretation vs Translation Translating C Programs Compiler Assembler Linker (next time) Loader (next time) An Example (next time) Overview CS61C L18 Running a Program I (5) Garcia, Spring 2008 © UCB Language Execution Continuum An Interpreter is a program that executes other programs. 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 up performance Easy to program Inefficient to interpret Efficient to interpret Difficult to program Scheme Java C++ C Assembly machine language Java bytecode CS61C L18 Running a Program I (6) Garcia, Spring 2008 © 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 CS61C L18 Running a Program I (7) Garcia, Spring 2008 © UCB Interpretation Scheme Interpreter is just a program that reads a scheme program and performs the functions of that scheme program.
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS61C L18 Running a Program I (8) Garcia, Spring 2008 © UCB Translation Scheme Compiler is a translator from Scheme to machine language. The processor is a hardware interpeter of machine language. CS61C L18 Running a Program I (9) Garcia, Spring 2008 © UCB Interpretation Any good reason to interpret machine language in software? SPIM – useful for learning / debugging
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

2008SpCS61C-L18-ddg-runprogI-6up - UCB CS61C : Machine...

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

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