o matter how well you write and understand high-level programming languages, your applications can probably benefit if you’re willing to dig down into the lower-level code that makes the computer work. And for most developers, that means learning assembly language and understanding compilers.
In Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level (No Starch Press, March 2006), author Randall Hyde speaks to a new generation of programmers who haven’t been taught assembly language, and many of whom haven’t been trained in a computer science curriculum. This book, the second installment in the popular Write Great Code series, explains how compilers work to translate high-level language statements and data structures into machine code. Armed with this understanding, programmers will be able to choose a proper mix of high-level language statements to produce more efficient software?all without having to give up the productivity and portability benefits of a high-level language.
The two chapters excerpted here should not only serve as a good introduction to the advantages of knowing lower-level programming, but also give you a good feel for the comprehensive coverage and the target audience level of this book.
Chapter 3, 80×86 Assembly for the High-level Language (HLL) Programmer, walks you through the 80×86 architecture, provides a basic overview of 80×86 assembly language, the addressing modes for this chip family, and then describes the various syntax forms used in common assemblers such as HLA, MASM/TASM, and Gas.
Chapter 8, Variables in a High-level Language, covers the low-level implementation of variables used in high-level languages, including the runtime memory organization, attributes that differentiate variables from other objects, the difference between static, automatic, and dynamic variables, and how machine instructions encode the address of a variable.
Reproduced from Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level by permission of No Starch Press. ISBN 1593270658, copyright 2006. All rights reserved.