L02 - CS61C Machine Structures Lecture 2 Introduction to...

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

View Full Document Right Arrow Icon
CS 61C L02 Introduction to C (1) Wawrzynek Fall 2007 © UCB 8/29/2007 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS61C – Machine Structures Lecture 2 – Introduction to the C Programming Language CS 61C L02 Introduction to C (2) Wawrzynek Fall 2007 © UCB Introduction to C Why learn C?
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 L02 Introduction to C (3) Wawrzynek Fall 2007 © UCB Disclaimer ° Important : You will not learn how to fully code in C in these lectures! You’ll still need your C reference for this course. K&R is a great reference. - But… check online for more sources. “JAVA in a Nutshell” – O’Reilly. - Chapter 2, “How Java Differs from C”. Brian Harvey’s course notes. - On class website, resources page CS 61C L02 Introduction to C (4) Wawrzynek Fall 2007 © UCB Compilation : Overview C compilers take C and convert it into an architecture specific machine code (string of 1s and 0s). Unlike Java which converts to architecture independent “bytecodes”. Unlike most Scheme environments which interpret the code. (These differ mainly in when your program is converted to machine instructions.) For C generally a 2 part process of compiling .c files to .o files, then linking the .o files into executables
Background image of page 2
CS 61C L02 Introduction to C (5) Wawrzynek Fall 2007 © UCB Compilation : characteristics ° Great run-time performance Generally much faster than Scheme or Java for comparable code Optimized for a given architecture ° OK compilation time Enhancements in compilation procedure (Makefiles) allow only modified files to be recompiled As computers get faster the gap closes CS 61C L02 Introduction to C (6) Wawrzynek Fall 2007 © UCB Compilation : Disadvantages ° All compiled files (including the executable) are architecture specific , depending on both the CPU type and the operating system. ° Executable must be rebuilt on each new system. Called “
Background image of page 3

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

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

Page1 / 12

L02 - CS61C Machine Structures Lecture 2 Introduction to...

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

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