EE 312 Exam 1 Notes

EE 312 Exam 1 Notes - EE 312 Notes Exam # 1 Chapter 11...

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

View Full Document Right Arrow Icon
EE 312 Notes – Exam # 1 Chapter 11 Translating High Level Programs You can translate a high level language by either interpretation or compilation Interpretation is done by an interpreter and compilation is done through a compiler. Both are programs themselves Interpretation o The interpreter reads the lines of commands and carries them out as defined by the language o The high level language is not directly executed by the computers hardware but is in fact just input data for the interpreter o For example if a line says “Take the square root of B and store it in C” then the interpreter will carry out the square root by issuing the correct stream of instructions in the ISA of the computer to perform the square root. Once that line is processed the interpreter goes to the next line o Examples of programs that are interpreted are Java, BASIC, and Pearl Compilation o Compilation on the other hand translates the language into machine code that can be directly executed by the computer’s hardware. o A program that is compiled once can be executed many times o Unlike the interpreter the compiler translates the language into machine code. We give it a file and it creates another file of just machine code. o The compiler does not execute our program but rather just translates it into machine code Pros and Cons o With an interpreter debugging can be easier because it allows the execution of a section at a time o The compiler is faster though because it translates it into a code that can be executed more quickly The C Programming Language Developed by Dennis Ritchie at Bell Laboratories in 1972 In 1989 the American National Standards Institute approved “an unambiguous and machine independent definition of the language C” in order to standardize the widely popular language The C Compiler o Typical mode of translation from a C source program to an executable image o An executable image is the machine language representation of the program that is ready to be loaded into memory and executed o The entire compilation process involves several components, only one of which is the compiler o Often the whole mechanism is casually referred to as the compiler because the preprocessor and the linker are invoked automatically o The Preprocessor The C preprocessor “preprocesses” the program before handing it over to the actual complier It scans the source files looking for and acting upon C preprocessor directives which are similar to LC-2 opcodes It inserts stdio.h into the source file at the current line All preprocessor directives start with # o The C Compiler The compiler then transforms the preprocessed program into an object module (which is the machine code for one section of the program) The compiler has two parts: analysis and synthesis Analysis first breaks down the program and then synthesis generates the machine code for it Compiler also generates the symbol table o The Linker
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/19/2008 for the course EE 312 taught by Professor Shafer during the Fall '08 term at University of Texas.

Page1 / 13

EE 312 Exam 1 Notes - EE 312 Notes Exam # 1 Chapter 11...

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

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