Book description
The second volume in the Write Great Code series supplies the critical information that today's computer science students don't often get from college and university courses: How to carefully choose their high-level language statements to produce efficient code. Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level , teaches software engineers how compilers translate high-level language statements and data structures into machine code. Armed with this knowledge, a software engineer can make an informed choice concerning the use of those high-level structures to help the compiler produce far better machine code--all without having to give up the productivity and portability benefits of using a high-level language.
Table of contents
- Write Great Code, Volume 2
- Acknowledgments
- Introduction
-
1. Thinking Low-Level, Writing High-Level
- 1.1 Misconceptions About Compiler Quality
- 1.2 Why Learning Assembly Language Is Still a Good Idea
- 1.3 Why Learning Assembly Language Isn’t Absolutely Necessary
- 1.4 Thinking Low-Level
- 1.5 Writing High-Level
- 1.6 Assumptions
- 1.7 Language-Neutral Approach
- 1.8 Characteristics of Great Code
- 1.9 The Environment for This Text
- 1.10 For More Information
-
2. Shouldn’t You Learn Assembly Language?
- 2.1 Roadblocks to Learning Assembly Language
- 2.2 Write Great Code, Volume 2, to the Rescue
- 2.3 High-Level Assemblers to the Rescue
- 2.4 The High-Level Assembler (HLA)
- 2.5 Thinking High-Level, Writing Low-Level
- 2.6 The Assembly Programming Paradigm (Thinking Low-Level)
- 2.7 The Art of Assembly Language and Other Resources
-
3. 80x86 Assembly for the HLL Programmer
- 3.1 Learning One Assembly Language Is Good, Learning More Is Better
- 3.2 80x86 Assembly Syntaxes
- 3.3 Basic 80x86 Architecture
- 3.4 Literal Constants
- 3.5 Manifest (Symbolic) Constants in Assembly Language
- 3.6 80x86 Addressing Modes
- 3.7 Declaring Data in Assembly Language
- 3.8 Specifying Operand Sizes in Assembly Language
- 3.9 The Minimal 80x86 Instruction Set
- 3.10 For More Information
-
4. PowerPC Assembly for the HLL Programmer
- 4.1 Learning One Assembly Language Is Good; More Is Better
- 4.2 Assembly Syntaxes
- 4.3 Basic PowerPC Architecture
- 4.4 Literal Constants
- 4.5 Manifest (Symbolic) Constants in Assembly Language
- 4.6 PowerPC Addressing Modes
- 4.7 Declaring Data in Assembly Language
- 4.8 Specifying Operand Sizes in Assembly Language
- 4.9 The Minimal Instruction Set
- 4.10 For More Information
-
5. Compiler Operation and Code Generation
- 5.1 File Types That Programming Languages Use
- 5.2 Programming Language Source Files
- 5.3 Types of Computer Language Processors
- 5.4 The Translation Process
- 5.5 Compiler Output
- 5.6 Object File Formats
- 5.7 Executable File Formats
- 5.8 Data and Code Alignment in an Object File
- 5.9 Linkers and Their Effect on Code
- 5.10 For More Information
-
6. Tools for Analyzing Compiler Output
- 6.1 Background
- 6.2 Telling a Compiler to Produce Assembly Output
-
6.3 Using Object-Code Utilities to Analyze Compiler Output
-
6.3.1 The Microsoft dumpbin.exe Utility
- 6.3.1.1 The dumpbin.exe /all Command-Line Option
- 6.3.1.2 The dumpbin.exe /disasm Command-Line Option
- 6.3.1.3 The dumpbin.exe /headers Command-Line Option
- 6.3.1.4 The dumpbin.exe /imports Command-Line Option
- 6.3.1.5 The dumpbin.exe /relocations Command-Line Option
- 6.3.1.6 Other dumpbin.exe Command-Line Options
- 6.3.2 The FSF/GNU objdump.exe Utility
-
6.3.1 The Microsoft dumpbin.exe Utility
- 6.4 Using a Disassembler to Analyze Compiler Output
- 6.5 Using a Debugger to Analyze Compiler Output
- 6.6 Comparing Output from Two Compilations
- 6.7 For More Information
-
7. Constants and High-Level Languages
- 7.1 Literal Constants and Program Efficiency
- 7.2 Literal Constants Versus Manifest Constants
- 7.3 Constant Expressions
- 7.4 Manifest Constants Versus Read-Only Memory Objects
- 7.5 Enumerated Types
- 7.6 Boolean Constants
- 7.7 Floating-Point Constants
- 7.8 String Constants
- 7.9 Composite Data Type Constants
- 7.10 For More Information
-
8. Variables in a High-Level Language
- 8.1 Runtime Memory Organization
- 8.2 What Is a Variable?
- 8.3 Variable Storage
- 8.4 Common Primitive Data Types
-
8.5 Variable Addresses and High-level Languages
- 8.5.1 Storage Allocation for Global and Static Variables
- 8.5.2 Using Automatic Variables to Reduce Offset Sizes
- 8.5.3 Storage Allocation for Intermediate Variables
- 8.5.4 Storage Allocation for Dynamic Variables and Pointers
- 8.5.5 Using Records/Structures to Reduce Instruction Offset Sizes
- 8.5.6 Register Variables
- 8.6 Variable Alignment in Memory
- 8.7 For More Information
-
9. Array Data Types
-
9.1 What Is an Array?
- 9.1.1 Array Declarations
- 9.1.2 Array Representation in Memory
- 9.1.3 Accessing Elements of an Array
- 9.1.4 Padding Versus Packing
-
9.1.5 Multidimensional Arrays
- 9.1.5.1 Declaring Multidimensional Arrays
- 9.1.5.2 Mapping Multidimensional Array Elements to Memory
- 9.1.5.3 Row-Major Ordering
- 9.1.5.4 Column-Major Ordering
- 9.1.5.5 Accessing Elements of a Multidimensional Array
- 9.1.5.6 Emulating Column-Major or Row-Major Ordering
- 9.1.5.7 Improving Array Access Efficiency in Your Applications
- 9.1.6 Dynamic Versus Static Arrays
- 9.2 For More Information
-
9.1 What Is an Array?
-
10. String Data Types
- 10.1 Character String Formats
- 10.2 Static, Pseudo-Dynamic, and Dynamic Strings
- 10.3 Reference Counting for Strings
- 10.4 Delphi/Kylix Strings
- 10.5 Using Strings in a High-Level Language
- 10.6 Character Data in Strings
- 10.7 For More Information
-
11. Pointer Data Types
- 11.1 Defining and Demystifying Pointers
- 11.2 Pointer Implementation in High-Level Languages
- 11.3 Pointers and Dynamic Memory Allocation
- 11.4 Pointer Operations and Pointer Arithmetic
- 11.5 A Simple Memory Allocator Example
- 11.6 Garbage Collection
- 11.7 The OS and Memory Allocation
- 11.8 Heap Memory Overhead
- 11.9 Common Pointer Problems
- 11.10 For More Information
-
12. Record Union, and Class Data Types
- 12.1 Records
- 12.2 Discriminant Unions
- 12.3 Union Declarations in Various Languages
- 12.4 Memory Storage of Unions
- 12.5 Other Uses of Unions
- 12.6 Variant Types
- 12.7 Namespaces
- 12.8 Classes and Objects
- 12.9 For More Information
-
13. Arithmetic and Logical Expressions
- 13.1 Arithmetic Expressions and Computer Architecture
- 13.2 Optimization of Arithmetic Statements
- 13.3 Side Effects in Arithmetic Expressions
- 13.4 Containing Side Effects: Sequence Points
- 13.5 Avoiding Problems Caused by Side Effects
- 13.6 Forcing a Particular Order of Evaluation
- 13.7 Short-Circuit Evaluation
- 13.8 The Relative Cost of Arithmetic Operations
- 13.9 For More Information
- 14. Control Structures and Programmatic Decisions
- 15. Iterative Control Structures
- 16. Functions and Procedures
- A. Engineering Software
- B. A Brief Comparison of the 80x86 and PowerPC CPU Families
- C. Online Appendices
- Index
- Colophon
- D. Updates
- Copyright
Product information
- Title: Write Great Code, Volume 2
- Author(s):
- Release date: March 2006
- Publisher(s): No Starch Press
- ISBN: 9781593270650
You might also like
book
Write Great Code, Volume 3
The field of software engineering may value team productivity over individual growth, but legendary computer scientist …
book
Write Great Code
If you've asked someone the secret to writing efficient, well-written software, the answer that you've probably …
book
Write Great Code, Volume 2, 2nd Edition
Today’s programming languages offer productivity and portability, but also make it easy to write sloppy code …
book
Code Craft
Many programmers know how to write correct code - code that works. But not all know …