Preface |
|
xiii | (4) |
Trademarks |
|
xvii | |
|
Chapter 1 Architecture and Implementation |
|
|
1 | (18) |
|
Analogy: Piano Architecture |
|
|
2 | (1) |
|
Types of Computer Languages |
|
|
3 | (1) |
|
Why Study Assembly Language? |
|
|
4 | (1) |
|
The Alpha and its Ancestors in a Superfamily |
|
|
5 | (2) |
|
SQUARES: A Comparative Programming Example |
|
|
7 | (5) |
|
|
12 | (5) |
|
Positional Coefficients and Weights |
|
|
12 | (1) |
|
Binary and Hexadecimal Representations |
|
|
13 | (2) |
|
|
15 | (2) |
|
|
17 | (1) |
|
|
17 | (2) |
|
Chapter 2 Computer Structures and the Alpha |
|
|
19 | (24) |
|
|
19 | (5) |
|
The Central Processing Unit |
|
|
20 | (1) |
|
|
21 | (3) |
|
|
24 | (1) |
|
|
24 | (3) |
|
Classes of Instruction Architectures |
|
|
27 | (2) |
|
Introduction to the Alpha |
|
|
29 | (1) |
|
Alpha Information Units and Data Types |
|
|
30 | (9) |
|
|
32 | (1) |
|
|
33 | (3) |
|
|
36 | (3) |
|
|
39 | (1) |
|
|
39 | (1) |
|
|
39 | (4) |
|
Chapter 3 The Program Assembler and Debugger |
|
|
43 | (36) |
|
Program Development Steps |
|
|
44 | (4) |
|
SQUARES2: A Variant Example |
|
|
48 | (2) |
|
Assembler Statement Types |
|
|
50 | (4) |
|
|
50 | (1) |
|
|
51 | (1) |
|
Classes of Alpha Assembly Language Operators |
|
|
52 | (2) |
|
The Functions of a Symbolic Assembler |
|
|
54 | (10) |
|
|
54 | (2) |
|
|
56 | (1) |
|
|
56 | (2) |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
61 | (1) |
|
Elements of a Listing File |
|
|
62 | (2) |
|
|
64 | (1) |
|
|
65 | (3) |
|
|
68 | (6) |
|
Capabilities of Debugger Programs |
|
|
68 | (3) |
|
Running SQUARES2 using dbx (Unix) |
|
|
71 | (1) |
|
Running SQUARES2 using the Open VMS Debugger |
|
|
72 | (1) |
|
Examples of Debugger Commands |
|
|
73 | (1) |
|
|
73 | (1) |
|
|
73 | (1) |
|
Using the screen mode (Open VMS) |
|
|
74 | (1) |
|
Comparing Variants of a Source File |
|
|
74 | (1) |
|
Conventions for Writing Programs |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
77 | (2) |
|
Chapter 4 Alpha Instruction Formats and Addressing |
|
|
79 | (34) |
|
Overview of Alpha Instruction Formats |
|
|
81 | (2) |
|
Integer Arithmetic Instructions |
|
|
83 | (4) |
|
Addition, Subtraction, and Multiplication |
|
|
83 | (3) |
|
|
86 | (1) |
|
Extended Precision Multiplication |
|
|
86 | (1) |
|
|
87 | (1) |
|
Introduction to Addressing Modes |
|
|
87 | (3) |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
|
88 | (2) |
|
Summary of Alpha Addressing Modes |
|
|
90 | (1) |
|
RADIX: Using Arithmetic Instructions |
|
|
90 | (3) |
|
Integer Load and Store Instructions |
|
|
93 | (8) |
|
Load Address Instructions |
|
|
93 | (2) |
|
Non-addressing Uses of Load Address Instructions |
|
|
95 | (1) |
|
Load and Store Operations |
|
|
96 | (2) |
|
Addressing Details in the RADIX Program |
|
|
98 | (1) |
|
|
98 | (2) |
|
|
100 | (1) |
|
Accessing Simple Record Structures Using Displacements |
|
|
101 | (1) |
|
DOT 3: Using Load and Store Instructions |
|
|
102 | (3) |
|
Addressing Modes in Other Architectures |
|
|
105 | (3) |
|
Scaled Addition and Subtraction Instructions |
|
|
108 | (1) |
|
|
109 | (1) |
|
|
109 | (1) |
|
|
110 | (3) |
|
Chapter 5 Branch Instructions and Logical Operations |
|
|
113 | (30) |
|
Types of Control Instructions |
|
|
114 | (1) |
|
Alpha Branch Instructions |
|
|
114 | (5) |
|
Conditional Branch Instructions |
|
|
116 | (1) |
|
Integer Compare Instructions |
|
|
116 | (2) |
|
Unconditional Branch Instruction |
|
|
118 | (1) |
|
DOT N: Using a Conditional Branch for Loop Control |
|
|
119 | (3) |
|
Locality and Symbolic Labels |
|
|
122 | (1) |
|
Loop Design and Program Efficiency |
|
|
123 | (1) |
|
Conditional Move Integer Instructions |
|
|
124 | (2) |
|
MAXIMUM: Using Conditional Move Instructions |
|
|
126 | (2) |
|
|
128 | (4) |
|
|
132 | (1) |
|
RADIX2: Using Logical and Shift Instructions |
|
|
133 | (2) |
|
Integer Division Revisited |
|
|
135 | (2) |
|
DECNUM: Converting an Integer to ASCII Decimal Format |
|
|
137 | (2) |
|
|
139 | (1) |
|
|
140 | (1) |
|
|
140 | (3) |
|
Chapter 6 Working with Bytes on the Alpha |
|
|
143 | (36) |
|
Extract Byte Instructions |
|
|
144 | (2) |
|
|
146 | (4) |
|
Loading an Unaligned Quadword |
|
|
147 | (1) |
|
Loading and Zero-Extending an Unaligned Longword |
|
|
148 | (1) |
|
Loading and Sign-Extending an Unaligned Longword |
|
|
149 | (1) |
|
Loading and Zero-Extending an Unaligned Word |
|
|
149 | (1) |
|
Loading and Sign-Extending an Unaligned Word |
|
|
149 | (1) |
|
Loading and Zero-Extending a Byte |
|
|
150 | (1) |
|
Loading and Sign-Extending a Byte |
|
|
150 | (1) |
|
SCANTEXT: An Example of Byte Input |
|
|
150 | (2) |
|
|
152 | (2) |
|
|
154 | (2) |
|
Storing Modified Unaligned Data |
|
|
156 | (4) |
|
Storing an Unaligned Quadword |
|
|
159 | (1) |
|
Storing an Unaligned Longword |
|
|
159 | (1) |
|
Storing an Unaligned Word |
|
|
160 | (1) |
|
|
160 | (1) |
|
Technical Specifications of the Extract, Insert, and Mask Byte Instructions |
|
|
160 | (3) |
|
Extract Byte Instructions |
|
|
161 | (1) |
|
|
162 | (1) |
|
|
163 | (1) |
|
Using C for ASCII Input and Output |
|
|
163 | (6) |
|
Introducing I/O for Open VMS |
|
|
165 | (2) |
|
|
167 | (2) |
|
BACKWARD: Using Byte Manipulations |
|
|
169 | (2) |
|
|
171 | (2) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
175 | (1) |
|
|
175 | (4) |
|
Chapter 7 Subroutines and Procedures |
|
|
179 | (54) |
|
|
180 | (3) |
|
|
180 | (2) |
|
|
182 | (1) |
|
Stack Conventions (Open VMS) |
|
|
182 | (1) |
|
|
182 | (1) |
|
DECNUM2: Stack Usage in an Algorithm |
|
|
183 | (2) |
|
Jump and Subroutine Instructions |
|
|
185 | (3) |
|
Branch to Subroutine Instruction |
|
|
188 | (1) |
|
NUMOUT: A Local Subroutine |
|
|
188 | (4) |
|
The Jump Group of Instructions |
|
|
192 | (5) |
|
|
193 | (2) |
|
|
195 | (1) |
|
|
196 | (1) |
|
Conventions for Register Use |
|
|
197 | (3) |
|
Passing Arguments to Procedures |
|
|
200 | (3) |
|
Argument Information Register (OpenVMS) |
|
|
200 | (1) |
|
|
201 | (1) |
|
String Descriptors (OpenVMS) |
|
|
202 | (1) |
|
Types of Alpha Procedures |
|
|
203 | (5) |
|
|
205 | (1) |
|
How Programs are Started by Operating Systems |
|
|
206 | (1) |
|
Data Section Pointer (Open VMS) |
|
|
207 | (1) |
|
|
208 | (1) |
|
Standard Prologue and Epilogue |
|
|
208 | (4) |
|
The $routine, $return, and $end routine Macros (Open VMS) |
|
|
209 | (2) |
|
Prologue and Epilogue for Unix |
|
|
211 | (1) |
|
Frame Pointer and Local Variables |
|
|
212 | (2) |
|
Stack Organization for Open VMS |
|
|
212 | (1) |
|
Stack Organization for Unix |
|
|
213 | (1) |
|
Integer Division on the Alpha |
|
|
214 | (2) |
|
Routines Related to Division (Open VMS) |
|
|
215 | (1) |
|
Pseudo-instructions for Division and Remainders (Unix) |
|
|
215 | (1) |
|
RANDOM: A Callable Procedure or Function |
|
|
216 | (11) |
|
RANDPROC: the Procedure Variant of RANDOM (Open VMS) |
|
|
217 | (3) |
|
RANDFUNC: the Function Variant of RANDOM (Open VMS) |
|
|
220 | (4) |
|
RANDFUNC: the Function Variant of RANDOM (Unix) |
|
|
224 | (3) |
|
The $call Macro (Open VMS) |
|
|
227 | (2) |
|
|
229 | (1) |
|
|
229 | (1) |
|
|
230 | (3) |
|
Chapter 8 Floating-Point Operations |
|
|
233 | (24) |
|
Parallels between Integer and Floating-Point Instructions |
|
|
234 | (1) |
|
|
235 | (1) |
|
Load and Store Floating-Point Instructions |
|
|
236 | (4) |
|
Loading and Storing 64-bit Data |
|
|
237 | (1) |
|
Loading and Storing 32-bit Data |
|
|
237 | (1) |
|
Addressing of Floating-Point Data in Memory |
|
|
238 | (2) |
|
Floating-Point Arithmetic Instructions |
|
|
240 | (4) |
|
Addition, Subtraction, Multiplication, and Division |
|
|
240 | (1) |
|
|
241 | (1) |
|
|
242 | (1) |
|
Function Field in Floating-Point Instructions |
|
|
243 | (1) |
|
Floating-Point Branch Instructions |
|
|
244 | (1) |
|
Floating-Point Compare Instructions |
|
|
245 | (1) |
|
Floating-Point Conditional Move Instructions |
|
|
246 | (1) |
|
|
247 | (1) |
|
Data Conversion Instructions |
|
|
248 | (2) |
|
APPROXPI: Using Floating-Point Instructions |
|
|
250 | (4) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
255 | (2) |
|
Chapter 9 Conditional Assembly and Macros |
|
|
257 | (30) |
|
|
258 | (3) |
|
|
258 | (1) |
|
Indefinite Repeat Blocks Using the .irp Directive |
|
|
259 | (1) |
|
Indefinite Repeat Blocks Using the .irpc Directive |
|
|
260 | (1) |
|
|
261 | (5) |
|
Conditional Assembly Blocks Using the .if Directive |
|
|
262 | (2) |
|
Single Conditional Alternative Using .else Directive |
|
|
264 | (1) |
|
Alternating the Conditional Assembly Using True-False Sense Switching |
|
|
265 | (1) |
|
One-Line Conditional Statements Using the .iif Directive |
|
|
265 | (1) |
|
|
266 | (9) |
|
|
267 | (1) |
|
|
268 | (1) |
|
Processing of Positional Parameters |
|
|
269 | (1) |
|
Processing of Default Values and Keyword Parameters |
|
|
270 | (2) |
|
Processing of String Parameters |
|
|
272 | (3) |
|
Generating Unique Labels with Macros |
|
|
275 | (1) |
|
Self-Redefining and Recursive Macros, .mdelete, and .mexit |
|
|
276 | (1) |
|
Controlling the Listing File |
|
|
277 | (1) |
|
Defining Additional Program Sections with .psect |
|
|
278 | (3) |
|
MONEY: a Macro Illustrating Program Sections |
|
|
281 | (3) |
|
|
284 | (1) |
|
|
284 | (1) |
|
|
284 | (3) |
|
Chapter 10 Input and Output of Text |
|
|
287 | (34) |
|
|
289 | (4) |
|
|
291 | (1) |
|
|
292 | (1) |
|
|
293 | (1) |
|
|
293 | (3) |
|
Unformatted Line I/O (gets and puts) |
|
|
295 | (1) |
|
Formatted I/O (printf and scanf) |
|
|
295 | (1) |
|
SCANTERM: Using C Standard I/O |
|
|
296 | (4) |
|
SORTSTR: Sorting Strings from stdin |
|
|
300 | (4) |
|
|
304 | (5) |
|
Directory-Level Access (fopen and fclose) |
|
|
306 | (1) |
|
Unformatted Line I/O (fgets and fputs) |
|
|
307 | (1) |
|
Formatted I/O (fprintf and fscanf) |
|
|
308 | (1) |
|
SCANFILE: Input and Output with Files |
|
|
309 | (4) |
|
SORTINT: Sorting Integers from a File |
|
|
313 | (4) |
|
|
317 | (1) |
|
|
317 | (1) |
|
|
318 | (1) |
|
|
318 | (3) |
|
Chapter 11 Performance Considerations |
|
|
321 | (32) |
|
Program Optimization Factors |
|
|
322 | (3) |
|
|
322 | (1) |
|
|
323 | (1) |
|
|
323 | (1) |
|
|
324 | (1) |
|
|
324 | (1) |
|
Recursion and Other Factors |
|
|
325 | (1) |
|
|
325 | (1) |
|
Local Variables in Recursion |
|
|
326 | (1) |
|
Three Fibonacci Implementations |
|
|
327 | (6) |
|
|
327 | (3) |
|
Internal Local Subroutine Call |
|
|
330 | (1) |
|
|
331 | (2) |
|
TESTFIB: Showing the Cost of Recursion |
|
|
333 | (2) |
|
|
335 | (6) |
|
|
336 | (3) |
|
|
339 | (2) |
|
|
341 | (8) |
|
|
343 | (1) |
|
|
344 | (1) |
|
|
345 | (1) |
|
Producer-Consumer Effects |
|
|
345 | (2) |
|
|
347 | (1) |
|
Multiplication by a Constant |
|
|
348 | (1) |
|
|
349 | (1) |
|
|
349 | (1) |
|
|
350 | (3) |
|
Chapter 12 Looking at Output from Compilers |
|
|
353 | (26) |
|
Why RISC Systems Need Good Compilers |
|
|
354 | (1) |
|
Compiling a Simple Program |
|
|
355 | (6) |
|
Optimizing a Simple Program |
|
|
361 | (4) |
|
|
364 | (1) |
|
|
364 | (1) |
|
|
365 | (1) |
|
Implementation-Dependent Optimizations |
|
|
365 | (5) |
|
Tuning for an Implementation |
|
|
368 | (1) |
|
Use of Newly-Added Instructions |
|
|
369 | (1) |
|
|
370 | (3) |
|
Post-Compilation Optimization |
|
|
373 | (1) |
|
Debugging Optimized Programs |
|
|
374 | (1) |
|
|
374 | (1) |
|
|
375 | (1) |
|
|
375 | (4) |
|
Chapter 13 Extensions to the Basic Alpha Architecture |
|
|
379 | (20) |
|
|
381 | (1) |
|
Alpha Implementation Differences |
|
|
382 | (2) |
|
|
384 | (2) |
|
|
386 | (2) |
|
|
388 | (1) |
|
Square Root and Floating-Point Register Move Extension |
|
|
389 | (2) |
|
|
390 | (1) |
|
Floating-Point Register Move Instructions |
|
|
390 | (1) |
|
Determining Extensions and Implementation Version |
|
|
391 | (1) |
|
Privileged Architecture Library |
|
|
392 | (4) |
|
|
393 | (1) |
|
|
393 | (1) |
|
Universal PALcode Instructions |
|
|
393 | (2) |
|
PALcode Specific to Operating Systems |
|
|
395 | (1) |
|
|
396 | (1) |
|
|
396 | (1) |
|
|
397 | (2) |
|
|
399 | (6) |
|
|
399 | (1) |
|
|
400 | (1) |
|
|
400 | (1) |
|
System Software for Programming Environments |
|
|
400 | (1) |
|
|
400 | (1) |
|
|
401 | (1) |
|
Desktop Client Access Software |
|
|
401 | (1) |
|
|
402 | (1) |
|
|
402 | (1) |
|
Windows NT on Alpha Systems |
|
|
402 | (1) |
|
|
403 | (1) |
|
Hardware-Level Information |
|
|
403 | (2) |
Answers and Hints for Selected Exercises |
|
405 | (8) |
Index |
|
413 | |