This preview shows page 1. Sign up to view the full content.
Unformatted text preview: produce good code. As programmers, we do not need to know the inner workings of the compiler in order to write efﬁcient code. However, in order to make good coding decisions in our C programs, we do need a basic understanding of assembly language and how the compiler translates different C statements into assembly language. For example, is a switch statement always more efﬁcient than a sequence of if-then-else statements? Just how expensive is a function call? Is a while loop more efﬁcient than a do loop? Are pointer references more efﬁcient than array indexes? Why does our loop run so much faster if we sum into a local variable instead of an argument that is passed by reference? Why do two functionally equivalent loops have such different running times? 1.4. PROCESSORS READ AND INTERPRET INSTRUCTIONS STORED IN MEMORY 5 In Chapter 3, we will introduce the Intel IA32 machine language and describe how compilers translate different C constructs into that language. In Chapter 5 we will...
View Full Document
- Spring '10
- The American