0%

Randall Hyde's The Art of Assembly Language has long been the go-to guide for learning assembly language. In this long-awaited follow-up, Hyde presents a 64-bit rewrite of his seminal text. It not only covers the instruction set for today’s x86-64 class of processors in-depth (using MASM), but also leads you through the maze of assembly language programming and machine organization by showing you how to write code that mimics operations in high-level languages.



Beginning with a “quick-start” chapter that gets you writing basic ASM applications as rapidly as possible, Hyde covers the fundamentals of machine organization, computer data representation and operations, and memory access. He’ll teach you assembly language programming, starting with basic data types and arithmetic, progressing through control structures and arithmetic to advanced topics like table lookups and string manipulation. In addition to the standard integer instruction set, the book covers the x87 FPU, single-instruction, multiple-data (SIMD) instructions, and MASM’s very powerful macro facilities. Throughout, you’ll benefit from a wide variety of ready-to-use library routines that simplify the programming process.



You’ll learn how to:



•Write standalone programs or link MASM programs with C/C++ code for calling routines in the C Standard Library
•Organize variable declarations to speed up access to data, and how to manipulate data on the x86-64 stack
•Implement HLL data structures and control structures in assembly language
•Convert various numeric formats, like integer to decimal string, floating-point to string, and hexadecimal string to integer
•Write parallel algorithms using SSE/AVX (SIMD) instructions
•Use macros to reduce the effort needed to write assembly language code

The Art of 64-bit Assembly, Volume 1 builds on the timeless material of its iconic predecessor, offering a comprehensive masterclass on writing complete applications in low-level programming languages.

Table of Contents

  1. Title Page
  2. Copyright
  3. Dedication
  4. About the Author
  5. Foreword
  6. Acknowledgments
  7. Introduction
  8. Part I: Machine Organization
    1. Chapter 1: Hello, World of Assembly Language
    2. 1.1 What You’ll Need
    3. 1.2 Setting Up MASM on Your Machine
    4. 1.3 Setting Up a Text Editor on Your Machine
    5. 1.4 The Anatomy of a MASM Program
    6. 1.5 Running Your First MASM Program
    7. 1.6 Running Your First MASM/C++ Hybrid Program
    8. 1.8 The Memory Subsystem
    9. 1.9 Declaring Memory Variables in MASM
    10. 1.9.1 Associating Memory Addresses with Variables
    11. 1.9.2 Associating Data Types with Variables
    12. 1.10 Declaring (Named) Constants in MASM
    13. 1.11 Some Basic Machine Instructions
    14. 1.11.1 The mov Instruction
    15. 1.11.2 Type Checking on Instruction Operands
    16. 1.11.3 The add and sub Instructions
    17. 1.11.4 The lea Instruction
    18. 1.11.5 The call and ret Instructions and MASM Procedures
    19. 1.12 Calling C/C++ Procedures
    20. 1.13 Hello, World!
    21. 1.14 Returning Function Results in Assembly Language
    22. 1.15 Automating the Build Process
    23. 1.16 Microsoft ABI Notes
    24. 1.16.1 Variable Size
    25. 1.16.2 Register Usage
    26. 1.16.3 Stack Alignment
    27. 1.17 For More Information
    28. 1.18 Test Yourself
    29. Chapter 2: Computer Data Representation and Operations
    30. 2.1 Numbering Systems
    31. 2.1.1 A Review of the Decimal System
    32. 2.1.2 The Binary Numbering System
    33. 2.1.3 Binary Conventions
    34. 2.2 The Hexadecimal Numbering System
    35. 2.3 A Note About Numbers vs. Representation
    36. 2.4 Data Organization
    37. 2.4.1 Bits
    38. 2.4.2 Nibbles
    39. 2.4.3 Bytes
    40. 2.4.4 Words
    41. 2.4.5 Double Words
    42. 2.4.6 Quad Words and Octal Words
    43. 2.5 Logical Operations on Bits
    44. 2.5.1 The AND Operation
    45. 2.5.2 The OR Operation
    46. 2.5.3 The XOR Operation
    47. 2.5.4 The NOT Operation
    48. 2.6 Logical Operations on Binary Numbers and Bit Strings
    49. 2.7 Signed and Unsigned Numbers
    50. 2.8 Sign Extension and Zero Extension
    51. 2.9 Sign Contraction and Saturation
    52. 2.10.1 The jmp Instruction
    53. 2.10.2 The Conditional Jump Instructions
    54. 2.10.3 The cmp Instruction and Corresponding Conditional Jumps
    55. 2.10.4 Conditional Jump Synonyms
    56. 2.11 Shifts and Rotates
    57. 2.12 Bit Fields and Packed Data
    58. 2.13 IEEE Floating-Point Formats
    59. 2.13.1 Single-Precision Format
    60. 2.13.2 Double-Precision Format
    61. 2.13.3 Extended-Precision Format
    62. 2.13.4 Normalized Floating-Point Values
    63. 2.13.5 Non-Numeric Values
    64. 2.13.6 MASM Support for Floating-Point Values
    65. 2.14 Binary-Coded Decimal Representation
    66. 2.15 Characters
    67. 2.15.1 The ASCII Character Encoding
    68. 2.15.2 MASM Support for ASCII Characters
    69. 2.16 The Unicode Character Set
    70. 2.16.1 Unicode Code Points
    71. 2.16.2 Unicode Code Planes
    72. 2.16.3 Unicode Encodings
    73. 2.17 MASM Support for Unicode
    74. 2.18 For More Information
    75. 2.19 Test Yourself
    76. Chapter 3: Memory Access and Organization
    77. 3.1 Runtime Memory Organization
    78. 3.1.1 The .code Section
    79. 3.1.2 The .data Section
    80. 3.1.3 The .const Section
    81. 3.1.4 The .data? Section
    82. 3.1.5 Organization of Declaration Sections Within Your Programs
    83. 3.1.6 Memory Access and 4K Memory Management Unit Pages
    84. 3.2 How MASM Allocates Memory for Variables
    85. 3.3 The Label Declaration
    86. 3.4 Little-Endian and Big-Endian Data Organization
    87. 3.5 Memory Access
    88. 3.6 MASM Support for Data Alignment
    89. 3.7 The x86-64 Addressing Modes
    90. 3.7.1 x86-64 Register Addressing Modes
    91. 3.7.2 x86-64 64-Bit Memory Addressing Modes
    92. 3.7.3 Large Address Unaware Applications
    93. 3.8 Address Expressions
    94. 3.9 The Stack Segment and the push and pop Instructions
    95. 3.9.1 The Basic push Instruction
    96. 3.9.2 The Basic pop Instruction
    97. 3.9.3 Preserving Registers with the push and pop Instructions
    98. 3.10 The Stack Is a LIFO Data Structure
    99. 3.11 Other push and pop Instructions
    100. 3.12 Removing Data from the Stack Without Popping It
    101. 3.13 Accessing Data You’ve Pushed onto the Stack Without Popping It
    102. 3.14 Microsoft ABI Notes
    103. 3.15 For More Information
    104. 3.16 Test Yourself
    105. Chapter 4: Constants, Variables, and Data Types
    106. 4.1 The imul Instruction
    107. 4.2 The inc and dec Instructions
    108. 4.3 MASM Constant Declarations
    109. 4.3.1 Constant Expressions
    110. 4.3.2 this and $ Operators
    111. 4.3.3 Constant Expression Evaluation
    112. 4.4 The MASM typedef Statement
    113. 4.5 Type Coercion
    114. 4.6 Pointer Data Types
    115. 4.6.1 Using Pointers in Assembly Language
    116. 4.6.2 Declaring Pointers in MASM
    117. 4.6.3 Pointer Constants and Pointer Constant Expressions
    118. 4.6.4 Pointer Variables and Dynamic Memory Allocation
    119. 4.6.5 Common Pointer Problems
    120. 4.7 Composite Data Types
    121. 4.8 Character Strings
    122. 4.8.1 Zero-Terminated Strings
    123. 4.8.2 Length-Prefixed Strings
    124. 4.8.3 String Descriptors
    125. 4.8.4 Pointers to Strings
    126. 4.8.5 String Functions
    127. 4.9 Arrays
    128. 4.9.1 Declaring Arrays in Your MASM Programs
    129. 4.9.2 Accessing Elements of a Single-Dimensional Array
    130. 4.9.3 Sorting an Array of Values
    131. 4.10 Multidimensional Arrays
    132. 4.10.1 Row-Major Ordering
    133. 4.10.2 Column-Major Ordering
    134. 4.10.3 Allocating Storage for Multidimensional Arrays
    135. 4.10.4 Accessing Multidimensional Array Elements in Assembly Language
    136. 4.11 Records/Structs
    137. 4.11.1 MASM Struct Declarations
    138. 4.11.2 Accessing Record/Struct Fields
    139. 4.11.3 Nesting MASM Structs
    140. 4.11.4 Initializing Struct Fields
    141. 4.11.5 Arrays of Structs
    142. 4.11.6 Aligning Fields Within a Record
    143. 4.12 Unions
    144. 4.12.1 Anonymous Unions
    145. 4.12.2 Variant Types
    146. 4.13 Microsoft ABI Notes
    147. 4.14 For More Information
    148. 4.15 Test Yourself
  9. Part II: Assembly Language Programming
    1. Chapter 5: Procedures
    2. 5.1 Implementing Procedures
    3. 5.1.1 The call and ret Instructions
    4. 5.1.2 Labels in a Procedure
    5. 5.2 Saving the State of the Machine
    6. 5.3 Procedures and the Stack
    7. 5.3.1 Activation Records
    8. 5.3.2 The Assembly Language Standard Entry Sequence
    9. 5.3.3 The Assembly Language Standard Exit Sequence
    10. 5.4 Local (Automatic) Variables
    11. 5.4.1 Low-Level Implementation of Automatic (Local) Variables
    12. 5.4.2 The MASM Local Directive
    13. 5.4.3 Automatic Allocation
    14. 5.5 Parameters
    15. 5.5.1 Pass by Value
    16. 5.5.2 Pass by Reference
    17. 5.5.3 Low-Level Parameter Implementation
    18. 5.5.4 Declaring Parameters with the proc Directive
    19. 5.5.5 Accessing Reference Parameters on the Stack
    20. 5.6 Calling Conventions and the Microsoft ABI
    21. 5.7 The Microsoft ABI and Microsoft Calling Convention
    22. 5.7.1 Data Types and the Microsoft ABI
    23. 5.7.2 Parameter Locations
    24. 5.7.3 Volatile and Nonvolatile Registers
    25. 5.7.4 Stack Alignment
    26. 5.7.5 Parameter Setup and Cleanup (or “What’s with These Magic Instructions?”)
    27. 5.8 Functions and Function Results
    28. 5.9 Recursion
    29. 5.10 Procedure Pointers
    30. 5.11 Procedural Parameters
    31. 5.12 Saving the State of the Machine, Part II
    32. 5.13 Microsoft ABI Notes
    33. 5.14 For More Information
    34. 5.15 Test Yourself
    35. Chapter 6: Arithmetic
    36. 6.1 x86-64 Integer Arithmetic Instructions
    37. 6.1.1 Sign- and Zero-Extension Instructions
    38. 6.1.2 The mul and imul Instructions
    39. 6.1.3 The div and idiv Instructions
    40. 6.1.4 The cmp Instruction, Revisited
    41. 6.1.5 The setcc Instructions
    42. 6.1.6 The test Instruction
    43. 6.2 Arithmetic Expressions
    44. 6.2.1 Simple Assignments
    45. 6.2.2 Simple Expressions
    46. 6.2.3 Complex Expressions
    47. 6.2.4 Commutative Operators
    48. 6.3 Logical (Boolean) Expressions
    49. 6.4 Machine and Arithmetic Idioms
    50. 6.4.1 Multiplying Without mul or imul
    51. 6.4.2 Dividing Without div or idiv
    52. 6.4.3 Implementing Modulo-N Counters with AND
    53. 6.5 Floating-Point Arithmetic
    54. 6.5.1 Floating-Point on the x86-64
    55. 6.5.2 FPU Registers
    56. 6.5.3 FPU Data Types
    57. 6.5.4 The FPU Instruction Set
    58. 6.5.5 FPU Data Movement Instructions
    59. 6.5.6 Conversions
    60. 6.5.7 Arithmetic Instructions
    61. 6.5.8 Comparison Instructions
    62. 6.5.9 Constant Instructions
    63. 6.5.10 Transcendental Instructions
    64. 6.5.11 Miscellaneous Instructions
    65. 6.6 Converting Floating-Point Expressions to Assembly Language
    66. 6.6.1 Converting Arithmetic Expressions to Postfix Notation
    67. 6.6.2 Converting Postfix Notation to Assembly Language
    68. 6.7 SSE Floating-Point Arithmetic
    69. 6.7.1 SSE MXCSR Register
    70. 6.7.2 SSE Floating-Point Move Instructions
    71. 6.7.3 SSE Floating-Point Arithmetic Instructions
    72. 6.7.4 SSE Floating-Point Comparisons
    73. 6.7.5 SSE Floating-Point Conversions
    74. 6.8 For More Information
    75. 6.9 Test Yourself
    76. Chapter 7: Low-Level Control Structures
    77. 7.1 Statement Labels
    78. 7.1.1 Using Local Symbols in Procedures
    79. 7.1.2 Initializing Arrays with Label Addresses
    80. 7.2 Unconditional Transfer of Control (jmp)
    81. 7.2.1 Register-Indirect Jumps
    82. 7.2.2 Memory-Indirect Jumps
    83. 7.3 Conditional Jump Instructions
    84. 7.4 Trampolines
    85. 7.5 Conditional Move Instructions
    86. 7.6 Implementing Common Control Structures in Assembly Language
    87. 7.6.1 Decisions
    88. 7.6.2 if/then/else Sequences
    89. 7.6.3 Complex if Statements Using Complete Boolean Evaluation
    90. 7.6.4 Short-Circuit Boolean Evaluation
    91. 7.6.5 Short-Circuit vs. Complete Boolean Evaluation
    92. 7.6.6 Efficient Implementation of if Statements in Assembly Language
    93. 7.6.7 switch/case Statements
    94. 7.7 State Machines and Indirect Jumps
    95. 7.8 Loops
    96. 7.8.1 while Loops
    97. 7.8.2 repeat/until Loops
    98. 7.8.3 forever/endfor Loops
    99. 7.8.4 for Loops
    100. 7.8.5 The break and continue Statements
    101. 7.8.6 Register Usage and Loops
    102. 7.9 Loop Performance Improvements
    103. 7.9.1 Moving the Termination Condition to the End of a Loop
    104. 7.9.2 Executing the Loop Backward
    105. 7.9.3 Using Loop-Invariant Computations
    106. 7.9.4 Unraveling Loops
    107. 7.9.5 Using Induction Variables
    108. 7.10 For More Information
    109. 7.11 Test Yourself
    110. Chapter 8: Advanced Arithmetic
    111. 8.1 Extended-Precision Operations
    112. 8.1.1 Extended-Precision Addition
    113. 8.1.2 Extended-Precision Subtraction
    114. 8.1.3 Extended-Precision Comparisons
    115. 8.1.4 Extended-Precision Multiplication
    116. 8.1.5 Extended-Precision Division
    117. 8.1.6 Extended-Precision Negation Operations
    118. 8.1.7 Extended-Precision AND Operations
    119. 8.1.8 Extended-Precision OR Operations
    120. 8.1.9 Extended-Precision XOR Operations
    121. 8.1.10 Extended-Precision NOT Operations
    122. 8.1.11 Extended-Precision Shift Operations
    123. 8.1.12 Extended-Precision Rotate Operations
    124. 8.2 Operating on Different-Size Operands
    125. 8.3 Decimal Arithmetic
    126. 8.3.1 Literal BCD Constants
    127. 8.3.2 Packed Decimal Arithmetic Using the FPU
    128. 8.4 For More Information
    129. 8.5 Test Yourself
    130. Chapter 9: Numeric Conversion
    131. 9.1 Converting Numeric Values to Strings
    132. 9.1.1 Converting Numeric Values to Hexadecimal Strings
    133. 9.1.2 Converting Extended-Precision Hexadecimal Values to Strings
    134. 9.1.3 Converting Unsigned Decimal Values to Strings
    135. 9.1.4 Converting Signed Integer Values to Strings
    136. 9.1.5 Converting Extended-Precision Unsigned Integers to Strings
    137. 9.1.6 Converting Extended-Precision Signed Decimal Values to Strings
    138. 9.1.7 Formatted Conversions
    139. 9.1.8 Converting Floating-Point Values to Strings
    140. 9.2 String-to-Numeric Conversion Routines
    141. 9.2.1 Converting Decimal Strings to Integers
    142. 9.2.2 Converting Hexadecimal Strings to Numeric Form
    143. 9.2.3 Converting Unsigned Decimal Strings to Integers
    144. 9.2.4 Conversion of Extended-Precision String to Unsigned Integer
    145. 9.2.5 Conversion of Extended-Precision Signed Decimal String to Integer
    146. 9.2.6 Conversion of Real String to Floating-Point
    147. 9.3 For More Information
    148. 9.4 Test Yourself
    149. Chapter 10: Table Lookups
    150. 10.1 Tables
    151. 10.1.1 Function Computation via Table Lookup
    152. 10.1.2 Generating Tables
    153. 10.1.3 Table-Lookup Performance
    154. 10.2 For More Information
    155. 10.3 Test Yourself
    156. Chapter 11: SIMD Instructions
    157. 11.1 The SSE/AVX Architectures
    158. 11.2 Streaming Data Types
    159. 11.3 Using cpuid to Differentiate Instruction Sets
    160. 11.4 Full-Segment Syntax and Segment Alignment
    161. 11.5 SSE, AVX, and AVX2 Memory Operand Alignment
    162. 11.6 SIMD Data Movement Instructions
    163. 11.6.1 The (v)movd and (v)movq Instructions
    164. 11.6.2 The (v)movaps, (v)movapd, and (v)movdqa Instructions
    165. 11.6.3 The (v)movups, (v)movupd, and (v)movdqu Instructions
    166. 11.6.4 Performance of Aligned and Unaligned Moves
    167. 11.6.5 The (v)movlps and (v)movlpd Instructions
    168. 11.6.6 The movhps and movhpd Instructions
    169. 11.6.7 The vmovhps and vmovhpd Instructions
    170. 11.6.8 The movlhps and vmovlhps Instructions
    171. 11.6.9 The movhlps and vmovhlps Instructions
    172. 11.6.10 The (v)movshdup and (v)movsldup Instructions
    173. 11.6.11 The (v)movddup Instruction
    174. 11.6.12 The (v)lddqu Instruction
    175. 11.6.13 Performance Issues and the SIMD Move Instructions
    176. 11.6.14 Some Final Comments on the SIMD Move Instructions
    177. 11.7 The Shuffle and Unpack Instructions
    178. 11.7.1 The (v)pshufb Instructions
    179. 11.7.2 The (v)pshufd Instructions
    180. 11.7.3 The (v)pshuflw and (v)pshufhw Instructions
    181. 11.7.4 The shufps and shufpd Instructions
    182. 11.7.5 The vshufps and vshufpd Instructions
    183. 11.7.6 The (v)unpcklps, (v)unpckhps, (v)unpcklpd, and (v)unpckhpd Instructions
    184. 11.7.7 The Integer Unpack Instructions
    185. 11.7.8 The (v)pextrb, (v)pextrw, (v)pextrd, and (v)pextrq Instructions
    186. 11.7.9 The (v)pinsrb, (v)pinsrw, (v)pinsrd, and (v)pinsrq Instructions
    187. 11.7.10 The (v)extractps and (v)insertps Instructions
    188. 11.8 SIMD Arithmetic and Logical Operations
    189. 11.9 The SIMD Logical (Bitwise) Instructions
    190. 11.9.1 The (v)ptest Instructions
    191. 11.9.2 The Byte Shift Instructions
    192. 11.9.3 The Bit Shift Instructions
    193. 11.10 The SIMD Integer Arithmetic Instructions
    194. 11.10.1 SIMD Integer Addition
    195. 11.10.2 Horizontal Additions
    196. 11.10.3 Double-Word–Sized Horizontal Additions
    197. 11.10.4 SIMD Integer Subtraction
    198. 11.10.5 SIMD Integer Multiplication
    199. 11.10.6 SIMD Integer Averages
    200. 11.10.7 SIMD Integer Minimum and Maximum
    201. 11.10.8 SIMD Integer Absolute Value
    202. 11.10.9 SIMD Integer Sign Adjustment Instructions
    203. 11.10.10 SIMD Integer Comparison Instructions
    204. 11.10.11 Integer Conversions
    205. 11.11 SIMD Floating-Point Arithmetic Operations
    206. 11.12 SIMD Floating-Point Comparison Instructions
    207. 11.12.1 SSE and AVX Comparisons
    208. 11.12.2 Unordered vs. Ordered Comparisons
    209. 11.12.3 Signaling and Quiet Comparisons
    210. 11.12.4 Instruction Synonyms
    211. 11.12.5 AVX Extended Comparisons
    212. 11.12.6 Using SIMD Comparison Instructions
    213. 11.12.7 The (v)movmskps, (v)movmskpd Instructions
    214. 11.13 Floating-Point Conversion Instructions
    215. 11.14 Aligning SIMD Memory Accesses
    216. 11.15 Aligning Word, Dword, and Qword Object Addresses
    217. 11.16 Filling an XMM Register with Several Copies of the Same Value
    218. 11.17 Loading Some Common Constants Into XMM and YMM Registers
    219. 11.18 Setting, Clearing, Inverting, and Testing a Single Bit in an SSE Register
    220. 11.19 Processing Two Vectors by Using a Single Incremented Index
    221. 11.20 Aligning Two Addresses to a Boundary
    222. 11.21 Working with Blocks of Data Whose Length Is Not a Multiple of the SSE/AVX Register Size
    223. 11.22 Dynamically Testing for a CPU Feature
    224. 11.23 The MASM Include Directive
    225. 11.24 And a Whole Lot More
    226. 11.25 For More Information
    227. 11.26 Test Yourself
    228. Chapter 12: Bit Manipulation
    229. 12.1 What Is Bit Data, Anyway?
    230. 12.2 Instructions That Manipulate Bits
    231. 12.2.1 The and Instruction
    232. 12.2.2 The or Instruction
    233. 12.2.3 The xor Instruction
    234. 12.2.4 Flag Modification by Logical Instructions
    235. 12.2.5 The Bit Test Instructions
    236. 12.2.6 Manipulating Bits with Shift and Rotate Instructions
    237. 12.3 The Carry Flag as a Bit Accumulator
    238. 12.4 Packing and Unpacking Bit Strings
    239. 12.5 BMI1 Instructions to Extract Bits and Create Bit Masks
    240. 12.6 Coalescing Bit Sets and Distributing Bit Strings
    241. 12.7 Coalescing and Distributing Bit Strings Using BMI2 Instructions
    242. 12.8 Packed Arrays of Bit Strings
    243. 12.9 Searching for a Bit
    244. 12.10 Counting Bits
    245. 12.11 Reversing a Bit String
    246. 12.12 Merging Bit Strings
    247. 12.13 Extracting Bit Strings
    248. 12.14 Searching for a Bit Pattern
    249. 12.15 For More Information
    250. 12.16 Test Yourself
    251. Chapter 13: Macros and the MASM Compile-Time Language
    252. 13.2 The echo and .err Directives
    253. 13.3 Compile-Time Constants and Variables
    254. 13.4 Compile-Time Expressions and Operators
    255. 13.4.1 The MASM Escape (!) Operator
    256. 13.4.2 The MASM Evaluation (%) Operator
    257. 13.4.3 The catstr Directive
    258. 13.4.4 The instr Directive
    259. 13.4.5 The sizestr Directive
    260. 13.4.6 The substr Directive
    261. 13.5 Conditional Assembly (Compile-Time Decisions)
    262. 13.6 Repetitive Assembly (Compile-Time Loops)
    263. 13.7 Macros (Compile-Time Procedures)
    264. 13.8 Standard Macros
    265. 13.9 Macro Parameters
    266. 13.9.1 Standard Macro Parameter Expansion
    267. 13.9.2 Optional and Required Macro Parameters
    268. 13.9.3 Default Macro Parameter Values
    269. 13.9.4 Macros with a Variable Number of Parameters
    270. 13.9.5 The Macro Expansion (&) Operator
    271. 13.10 Local Symbols in a Macro
    272. 13.11 The exitm Directive
    273. 13.12 MASM Macro Function Syntax
    274. 13.13 Macros as Compile-Time Procedures and Functions
    275. 13.14 Writing Compile-Time “Programs”
    276. 13.14.1 Constructing Data Tables at Compile Time
    277. 13.14.2 Unrolling Loops
    278. 13.15 Simulating HLL Procedure Calls
    279. 13.15.1 HLL-Like Calls with No Parameters
    280. 13.15.2 HLL-Like Calls with One Parameter
    281. 13.15.3 Using opattr to Determine Argument Types
    282. 13.15.4 HLL-Like Calls with a Fixed Number of Parameters
    283. 13.15.5 HLL-Like Calls with a Varying Parameter List
    284. 13.16 The invoke Macro
    285. 13.17 Advanced Macro Parameter Parsing
    286. 13.17.1 Checking for String Literal Constants
    287. 13.17.2 Checking for Real Constants
    288. 13.17.3 Checking for Registers
    289. 13.17.4 Compile-Time Arrays
    290. 13.18 Using Macros to Write Macros
    291. 13.19 Compile-Time Program Performance
    292. 13.20 For More Information
    293. 13.21 Test Yourself
    294. Chapter 14: The String Instructions
    295. 14.1 The x86-64 String Instructions
    296. 14.1.1 The rep, repe, repz, and the repnz and repne Prefixes
    297. 14.1.2 The Direction Flag
    298. 14.1.3 The movs Instruction
    299. 14.1.4 The cmps Instruction
    300. 14.1.5 The scas Instruction
    301. 14.1.6 The stos Instruction
    302. 14.1.7 The lods Instruction
    303. 14.1.8 Building Complex String Functions from lods and stos
    304. 14.2 Performance of the x86-64 String Instructions
    305. 14.3 SIMD String Instructions
    306. 14.3.1 Packed Compare Operand Sizes
    307. 14.3.2 Type of Comparison
    308. 14.3.3 Result Polarity
    309. 14.3.4 Output Processing
    310. 14.3.5 Packed String Compare Lengths
    311. 14.3.6 Packed String Comparison Results
    312. 14.4 Alignment and Memory Management Unit Pages
    313. 14.5 For More Information
    314. 14.6 Test Yourself
    315. Chapter 15: Managing Complex Projects
    316. 15.1 The include Directive
    317. 15.2 Ignoring Duplicate Include Operations
    318. 15.3 Assembly Units and External Directives
    319. 15.4 Header Files in MASM
    320. 15.5 The externdef Directive
    321. 15.6 Separate Compilation
    322. 15.7.1 Basic Makefile Syntax
    323. 15.7.2 Make Dependencies
    324. 15.7.3 Make Clean and Touch
    325. 15.8 The Microsoft Linker and Library Code
    326. 15.9 Object File and Library Impact on Program Size
    327. 15.10 For More Information
    328. 15.11 Test Yourself
    329. Chapter 16: Stand-Alone Assembly Language Programs
    330. 16.1 Hello World, by Itself
    331. 16.2 Header Files and the Windows Interface
    332. 16.3 The Win32 API and the Windows ABI
    333. 16.4 Building a Stand-Alone Console Application
    334. 16.5 Building a Stand-Alone GUI Application
    335. 16.6 A Brief Look at the MessageBox Windows API Function
    336. 16.7 Windows File I/O
    337. 16.8 Windows Applications
    338. 16.9 For More Information
    339. 16.10 Test Yourself
  10. Part III: Reference Material
    1. Appendix A: ASCII Character Set
    2. Appendix B: Glossary
    3. Appendix C: Installing and Using Visual Studio
    4. C.1 Installing Visual Studio Community
    5. C.2 Creating a Command Line Prompt for MASM
    6. C.3 Editing, Assembling, and Running a MASM Source File
    7. Appendix D: The Windows Command Line Interpreter
    8. D.1 Command Line Syntax
    9. D.2 Directory Names and Drive Letters
    10. D.3 Some Useful Built-in Commands
    11. D.3.1 The cd and chdir Commands
    12. D.3.2 The cls Command
    13. D.3.3 The copy Command
    14. D.3.4 The date Command
    15. D.3.5 The del (erase) Command
    16. D.3.6 The dir Command
    17. D.3.7 The more Command
    18. D.3.8 The move Command
    19. D.3.9 The ren and rename Commands
    20. D.3.10 The rd and rmdir Commands
    21. D.3.11 The time Command
    22. D.4 For More Information
    23. Appendix E: Answers to Questions
    24. E.1 Answers to Questions in Chapter 1
    25. E.2 Answers to Questions in Chapter 2
    26. E.3 Answers to Questions in Chapter 3
    27. E.4 Answers to Questions in Chapter 4
    28. E.5 Answers to Questions in Chapter 5
    29. E.6 Answers to Questions in Chapter 6
    30. E.7 Answers to Questions in Chapter 7
    31. E.8 Answers to Questions in Chapter 8
    32. E.9 Answers to Questions in Chapter 9
    33. E.10 Answers to Questions in Chapter 10
    34. E.11 Answers to Questions in Chapter 11
    35. E.12 Answers to Questions in Chapter 12
    36. E.13 Answers to Questions in Chapter 13
    37. E.14 Answers to Questions in Chapter 14
    38. E.15 Answers to Questions in Chapter 15
    39. E.16 Answers to Questions in Chapter 16
  11. Index
18.188.20.56