Preface |
|
xv | |
Who This Book Is For |
|
xv | |
About This Book |
|
xvi | |
The Programming in the Book |
|
xvi | |
Why Read This Book? |
|
xvii | |
Chapter Organization |
|
xvii | |
Efficient Use of This Book |
|
xix | |
Acknowledgments |
|
xxi | |
|
Chapter 1 Setting the Stage |
|
|
1 | (8) |
|
|
1 | (1) |
|
|
2 | (2) |
|
The Programming Environment |
|
|
4 | (2) |
|
|
6 | (3) |
|
Chapter 2 Data Storage Formats |
|
|
9 | (30) |
|
Describing Switches and Groups of Switches |
|
|
10 | (1) |
|
Representing Switches with Bits |
|
|
10 | (1) |
|
Representing Groups of Bits |
|
|
10 | (2) |
|
|
12 | (1) |
|
The Mathematical Equivalence of Binary and Decimal |
|
|
13 | (1) |
|
Getting to Know Positional Notation |
|
|
13 | (2) |
|
Converting Binary to Unsigned Decimal |
|
|
15 | (1) |
|
Converting Unsigned Decimal to Binary |
|
|
16 | (2) |
|
|
18 | (1) |
|
Expressing Memory Addresses |
|
|
19 | (1) |
|
|
20 | (3) |
|
|
23 | (2) |
|
Exploring Data Formats with C |
|
|
25 | (1) |
|
|
25 | (2) |
|
Writing and Executing Your First C Program |
|
|
27 | (3) |
|
Examining Memory with a Debugger |
|
|
30 | (1) |
|
|
31 | (4) |
|
Understanding Byte Storage Order in Memory |
|
|
35 | (1) |
|
|
36 | (3) |
|
Chapter 3 Computer Arithmetic |
|
|
39 | (18) |
|
Adding and Subtracting Unsigned Integers |
|
|
40 | (1) |
|
Adding in the Decimal Number System |
|
|
40 | (1) |
|
Subtracting in the Decimal Number System |
|
|
41 | (2) |
|
Adding and Subtracting Unsigned Integers in Binary |
|
|
43 | (2) |
|
Adding and Subtracting Signed Integers |
|
|
45 | (1) |
|
|
45 | (3) |
|
Computing Two's Complement |
|
|
48 | (2) |
|
Adding and Subtracting Signed Integers in Binary |
|
|
50 | (3) |
|
Circular Nature of Integer Codes |
|
|
53 | (2) |
|
|
55 | (2) |
|
Chapter 4 Boolean Algebra |
|
|
57 | (32) |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
61 | (1) |
|
Boolean Algebra Rules That Are the Same as Elementary Algebra |
|
|
61 | (2) |
|
Boolean Algebra Rules That Differ from Elementary Algebra |
|
|
63 | (3) |
|
|
66 | (1) |
|
Canonical Sum or Sum of Minterms |
|
|
67 | (2) |
|
Canonical Product or Product of Maxterms |
|
|
69 | (1) |
|
Comparison of Canonical Boolean Forms |
|
|
70 | (1) |
|
Boolean Expression Minimization |
|
|
71 | (1) |
|
|
71 | (2) |
|
Minimization Using Algebraic Manipulations |
|
|
73 | (3) |
|
Minimization Using Karnaugh Maps |
|
|
76 | (10) |
|
Combining Basic Boolean Operators |
|
|
86 | (2) |
|
|
88 | (1) |
|
|
89 | (24) |
|
Crash Course in Electronics |
|
|
90 | (1) |
|
Power Supplies and Batteries |
|
|
90 | (1) |
|
|
91 | (9) |
|
|
100 | (1) |
|
|
101 | (3) |
|
|
104 | (3) |
|
|
107 | (1) |
|
|
108 | (3) |
|
|
111 | (2) |
|
Chapter 6 Combinational Logic Circuits |
|
|
113 | (22) |
|
The Two Classes of Logic Circuits |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
115 | (1) |
|
|
116 | (1) |
|
Full Adder from Two Half Adders |
|
|
117 | (2) |
|
Ripple-Carry Addition and Subtraction Circuits |
|
|
119 | (2) |
|
|
121 | (3) |
|
|
124 | (1) |
|
|
125 | (2) |
|
Programmable Logic Devices |
|
|
127 | (1) |
|
|
128 | (2) |
|
|
130 | (1) |
|
|
131 | (2) |
|
|
133 | (2) |
|
Chapter 7 Sequential Logic Circuits |
|
|
135 | (28) |
|
|
136 | (1) |
|
|
136 | (3) |
|
SR Latch Using NAND Gates |
|
|
139 | (2) |
|
|
141 | (1) |
|
|
142 | (2) |
|
|
144 | (1) |
|
|
144 | (1) |
|
|
145 | (2) |
|
|
147 | (1) |
|
|
148 | (3) |
|
Designing Sequential Logic Circuits |
|
|
151 | (1) |
|
|
152 | (4) |
|
Designing a Branch Predictor |
|
|
156 | (5) |
|
|
161 | (2) |
|
|
163 | (14) |
|
|
163 | (1) |
|
|
164 | (1) |
|
|
165 | (1) |
|
|
166 | (2) |
|
|
168 | (1) |
|
Implementing Memory in Hardware |
|
|
168 | (1) |
|
|
168 | (3) |
|
|
171 | (1) |
|
|
172 | (1) |
|
|
172 | (1) |
|
Static Random-Access Memory |
|
|
173 | (2) |
|
Dynamic Random-Access Memory |
|
|
175 | (1) |
|
|
176 | (1) |
|
Chapter 9 Central Processing Unit |
|
|
177 | (18) |
|
|
178 | (1) |
|
|
178 | (2) |
|
Instruction Execution Cycle |
|
|
180 | (2) |
|
|
182 | (1) |
|
General-Purpose Registers |
|
|
183 | (3) |
|
|
186 | (1) |
|
C/C++ Integral Data Types and Register Sizes |
|
|
187 | (1) |
|
Using gdb to View the CPU Registers |
|
|
188 | (5) |
|
|
193 | (2) |
|
Chapter 10 Programming in Assembly Language |
|
|
195 | (26) |
|
Compiling a Program Written in C |
|
|
196 | (1) |
|
From C to Assembly Language |
|
|
197 | (2) |
|
Assembler Directives That We Won't Use |
|
|
199 | (3) |
|
Assembler Directives That We Will Use |
|
|
202 | (1) |
|
Creating a Program in Assembly Language |
|
|
203 | (1) |
|
Assembly Language in General |
|
|
204 | (1) |
|
First Assembly Language Instructions |
|
|
205 | (3) |
|
Minimal Processing in a Function |
|
|
208 | (2) |
|
Using gdb to Learn Assembly Language |
|
|
210 | (7) |
|
|
217 | (1) |
|
|
218 | (3) |
|
Chapter 11 Inside the Main Function |
|
|
221 | (24) |
|
The write and read System Call Functions |
|
|
222 | (1) |
|
Passing Arguments in Registers |
|
|
223 | (2) |
|
Position-Independent Code |
|
|
225 | (2) |
|
|
227 | (1) |
|
|
227 | (2) |
|
Inside the Function Prologue and Epilogue |
|
|
229 | (4) |
|
Local Variables in a Function |
|
|
233 | (1) |
|
|
234 | (3) |
|
|
237 | (4) |
|
Not Using the C Runtime Environment |
|
|
241 | (2) |
|
|
243 | (2) |
|
Chapter 12 Instruction Details |
|
|
245 | (18) |
|
|
246 | (1) |
|
|
247 | (1) |
|
|
247 | (1) |
|
|
248 | (2) |
|
|
250 | (1) |
|
Immediate Addressing Mode |
|
|
250 | (2) |
|
|
252 | (1) |
|
|
252 | (1) |
|
Register Indirect with Offset |
|
|
253 | (2) |
|
Register Indirect with Indexing |
|
|
255 | (1) |
|
|
255 | (1) |
|
|
256 | (2) |
|
|
258 | (1) |
|
|
258 | (2) |
|
|
260 | (1) |
|
|
261 | (2) |
|
Chapter 13 Control Flow Constructs |
|
|
263 | (24) |
|
|
264 | (1) |
|
|
264 | (1) |
|
|
265 | (2) |
|
|
267 | (1) |
|
|
267 | (5) |
|
|
272 | (2) |
|
|
274 | (2) |
|
|
276 | (1) |
|
|
276 | (2) |
|
|
278 | (4) |
|
|
282 | (4) |
|
|
286 | (1) |
|
Chapter 14 Inside Subfunctions |
|
|
287 | (32) |
|
Scope of Variable Names in C |
|
|
288 | (1) |
|
Overview of Passing Arguments |
|
|
289 | (1) |
|
|
290 | (4) |
|
Explicitly Passing Arguments |
|
|
294 | (1) |
|
|
294 | (2) |
|
What's Going On in Assembly Language |
|
|
296 | (3) |
|
Handling More Than Six Arguments |
|
|
299 | (1) |
|
Pushing Arguments onto the Stack |
|
|
299 | (4) |
|
Storing Arguments Directly on the Stack |
|
|
303 | (3) |
|
Summary of Stack Frame Usage |
|
|
306 | (3) |
|
|
309 | (9) |
|
|
318 | (1) |
|
Chapter 15 Special Uses of Subfunctions |
|
|
319 | (16) |
|
|
319 | (7) |
|
Accessing CPU Features in Assembly Language |
|
|
326 | (1) |
|
A Separate Function Written in Assembly Language |
|
|
326 | (6) |
|
|
332 | (2) |
|
|
334 | (1) |
|
Chapter 16 Computing With Bitwise Logic, Multiplication, and Division Instructions |
|
|
335 | (36) |
|
|
335 | (1) |
|
|
336 | (3) |
|
|
339 | (1) |
|
Bit Masking in Assembly Language |
|
|
340 | (3) |
|
|
343 | (1) |
|
|
343 | (4) |
|
|
347 | (2) |
|
Shifting Bits in Assembly Language |
|
|
349 | (3) |
|
|
352 | (1) |
|
|
352 | (3) |
|
|
355 | (2) |
|
Multiplication in Assembly Language |
|
|
357 | (3) |
|
|
360 | (1) |
|
|
360 | (4) |
|
|
364 | (2) |
|
Division in Assembly Language |
|
|
366 | (4) |
|
|
370 | (1) |
|
Chapter 17 Data Structures |
|
|
371 | (24) |
|
|
272 | (100) |
|
|
372 | (4) |
|
Arrays in Assembly Language |
|
|
376 | (4) |
|
|
380 | (1) |
|
|
380 | (2) |
|
Records in Assembly Language |
|
|
382 | (1) |
|
Passing Records to Other Functions in C |
|
|
383 | (6) |
|
Passing Records to Other Functions in Assembly Language |
|
|
389 | (5) |
|
|
394 | (1) |
|
Chapter 18 Object-Oriented Programming |
|
|
395 | (20) |
|
|
396 | (2) |
|
|
398 | (3) |
|
Defining Class Member Functions |
|
|
401 | (4) |
|
Letting the Compiler Write a Constructor and Destructor |
|
|
405 | (2) |
|
Objects in Assembly Language |
|
|
407 | (6) |
|
|
413 | (2) |
|
Chapter 19 Fractional Numbers |
|
|
415 | (28) |
|
Fractional Values in Binary |
|
|
416 | (1) |
|
|
417 | (1) |
|
When the Fractional Part Is a Sum of Inverse Powers of Two |
|
|
417 | (4) |
|
When the Fractional Part Is in Decimal |
|
|
421 | (4) |
|
|
425 | (1) |
|
Floating-Point Representation |
|
|
425 | (1) |
|
IEEE 754 Floating-Point Standard |
|
|
426 | (1) |
|
SSE2 Floating-Point Hardware |
|
|
427 | (1) |
|
|
428 | (2) |
|
Programming with Floating-Point Numbers |
|
|
430 | (3) |
|
Floating-Point Arithmetic Errors |
|
|
433 | (7) |
|
Comments About Numerical Accuracy |
|
|
440 | (1) |
|
|
441 | (2) |
|
|
443 | (22) |
|
|
444 | (1) |
|
|
444 | (1) |
|
|
444 | (1) |
|
|
445 | (1) |
|
|
446 | (1) |
|
|
447 | (1) |
|
|
447 | (2) |
|
|
449 | (1) |
|
|
449 | (1) |
|
|
449 | (1) |
|
|
450 | (1) |
|
Polled I/O Programming Algorithms |
|
|
450 | (2) |
|
UART Memory-Mapped I/O in C |
|
|
452 | (5) |
|
UART Memory-Mapped I/O in Assembly Language |
|
|
457 | (3) |
|
|
460 | (4) |
|
|
464 | (1) |
|
Chapter 21 Interrupts and Exceptions |
|
|
465 | (12) |
|
|
466 | (1) |
|
CPU Response to an Interrupt or Exception |
|
|
467 | (1) |
|
|
468 | (1) |
|
|
469 | (1) |
|
|
469 | (1) |
|
|
470 | (1) |
|
The int 0×80 Software Interrupt |
|
|
470 | (2) |
|
|
472 | (2) |
|
|
474 | (3) |
Index |
|
477 | |