You are previewing Modern X86 Assembly Language Programming: 32-bit, 64-bit, SSE, and AVX.
O'Reilly logo
Modern X86 Assembly Language Programming: 32-bit, 64-bit, SSE, and AVX

Book Description

Modern X86 Assembly Language Programming shows the fundamentals of x86 assembly language programming. It focuses on the aspects of the x86 instruction set that are most relevant to application software development. The book's structure and sample code are designed to help the reader quickly understand x86 assembly language programming and the computational capabilities of the x86 platform. Book appendixes can be downloaded here: http://www.apress.com/9781484200650?gtmf=s

Major topics of the book include the following:

  • 32-bit core architecture, data types, internal registers, memory addressing modes, and the basic instruction set
  • X87 core architecture, register stack, special purpose registers, floating-point encodings, and instruction set
  • MMX technology and instruction set
  • Streaming SIMD extensions (SSE) and Advanced Vector Extensions (AVX) including internal registers, packed integer arithmetic, packed and scalar floating-point arithmetic, and associated instruction sets
  • 64-bit core architecture, data types, internal registers, memory addressing modes, and the basic instruction set
  • 64-bit extensions to SSE and AVX technologies
  • X86 assembly language optimization strategies and techniques
  • Table of Contents

    1. Cover
    2. Title
    3. Copyright
    4. Dedication
    5. Contents at a Glance
    6. Contents
    7. About the Author
    8. About the Technical Reviewer
    9. Acknowledgments
    10. Introduction
    11. Chapter 1: X86-32 Core Architecture
      1. Historical Overview
      2. Data Types
        1. Fundamental Data Types
        2. Numerical Data Types
        3. Packed Data Types
        4. Miscellaneous Data Types
      3. Internal Architecture
        1. Segment Registers
        2. General-Purpose Registers
        3. EFLAGS Register
        4. Instruction Pointer
        5. Instruction Operands
        6. Memory Addressing Modes
      4. Instruction Set Overview
        1. Data Transfer
        2. Binary Arithmetic
        3. Data Comparison
        4. Data Conversion
        5. Logical
        6. Rotate and Shift
        7. Byte Set and Bit String
        8. String
        9. Flag Manipulation
        10. Control Transfer
        11. Miscellaneous
      5. Summary
    12. Chapter 2: X86-32 Core Programming
      1. Getting Started
        1. First Assembly Language Function
        2. Integer Multiplication and Division
      2. X86-32 Programming Fundamentals
        1. Calling Convention
        2. Memory Addressing Modes
        3. Integer Addition
        4. Condition Codes
      3. Arrays
        1. One-Dimensional Arrays
        2. Two-Dimensional Arrays
      4. Structures
        1. Simple Structures
        2. Dynamic Structure Creation
      5. Strings
        1. Counting Characters
        2. String Concatenation
        3. Comparing Arrays
        4. Array Reversal
      6. Summary
    13. Chapter 3: X87 Floating-Point Unit
      1. X87 FPU Core Architecture
        1. Data Registers
        2. X87 FPU Special-Purpose Registers
        3. X87 FPU Operands and Encodings
      2. X87 FPU Instruction Set
        1. Data Transfer
        2. Basic Arithmetic
        3. Data Comparison
        4. Transcendental
        5. Constants
        6. Control
      3. Summary
    14. Chapter 4: X87 FPU Programming
      1. X87 FPU Programming Fundamentals
        1. Simple Arithmetic
        2. Floating-Point Compares
      2. X87 FPU Advanced Programming
        1. Floating-Point Arrays
        2. Transcendental Instructions
        3. Advanced Stack Usage
      3. Summary
    15. Chapter 5: MMX Technology
      1. SIMD Processing Concepts
      2. Wraparound vs. Saturated Arithmetic
      3. MMX Execution Environment
      4. MMX Instruction Set
        1. Data Transfer
        2. Arithmetic
        3. Comparison
        4. Conversion
        5. Logical and Shift
        6. Unpack and Shuffle
        7. Insertion and Extraction
        8. State and Cache Control
      5. Summary
    16. Chapter 6: MMX Technology Programming
      1. MMX Programming Fundamentals
        1. Packed Integer Addition
        2. Packed Integer Shifts
        3. Packed Integer Multiplication
      2. MMX Advanced Programming
        1. Integer Array Processing
        2. Using MMX and the x87 FPU
      3. Summary
    17. Chapter 7: Streaming SIMD Extensions
      1. X86-SSE Overview
      2. X86-SSE Execution Environment
        1. X86-SSE Register Set
        2. X86-SSE Data Types
        3. X86-SSE Control-Status Register
      3. X86-SSE Processing Techniques
      4. X86-SSE Instruction Set Overview
        1. Scalar Floating-Point Data Transfer
        2. Scalar Floating-Point Arithmetic
        3. Scalar Floating-Point Comparison
        4. Scalar Floating-Point Conversion
        5. Packed Floating-Point Data Transfer
        6. Packed Floating-Point Arithmetic
        7. Packed Floating-Point Comparison
        8. Packed Floating-Point Conversion
        9. Packed Floating-Point Shuffle and Unpack
        10. Packed Floating-Point Insertion and Extraction
        11. Packed Floating-Point Blend
        12. Packed Floating-Point Logical
        13. Packed Integer Extensions
        14. Packed Integer Data Transfer
        15. Packed Integer Arithmetic
        16. Packed Integer Comparison
        17. Packed Integer Conversion
        18. Packed Integer Shuffle and Unpack
        19. Packed Integer Insertion and Extraction
        20. Packed Integer Blend
        21. Packed Integer Shift
        22. Text String Processing
        23. Non-Temporal Data Transfer and Cache Control
        24. Miscellaneous
      5. Summary
    18. Chapter 8: X86-SSE programming – Scalar Floating-Point
      1. Scalar Floating-Point Fundamentals
        1. Scalar Floating-Point Arithmetic
        2. Scalar Floating-Point Compare
        3. Scalar Floating-Point Conversions
      2. Advanced Scalar Floating-Point Programming
        1. Scalar Floating-Point Spheres
        2. Scalar Floating-Point Parallelograms
      3. Summary
    19. Chapter 9: X86-SSE Programming – Packed Floating-Point
      1. Packed Floating-Point Fundamentals
        1. Packed Floating-Point Arithmetic
        2. Packed Floating-Point Compare
        3. Packed Floating-Point Conversions
      2. Advanced Packed Floating-Point Programming
        1. Packed Floating-Point Least Squares
        2. Packed Floating-Point 4 × 4 Matrices
      3. Summary
    20. Chapter 10: X86-SSE Programming – Packed Integers
      1. Packed Integer Fundamentals
      2. Advanced Packed Integer Programming
        1. Packed Integer Histogram
        2. Packed Integer Threshold
      3. Summary
    21. Chapter 11: X86-SSE Programming – Text Strings
      1. Text String Fundamentals
      2. Text String Programming
        1. Text String Calculate Length
        2. Text String Replace Characters
      3. Summary
    22. Chapter 12: Advanced Vector Extensions (AVX)
      1. X86-AVX Overview
      2. X86-AVX Execution Environment
        1. X86-AVX Register Set
        2. X86-AVX Data Types
        3. X86-AVX Instruction Syntax
      3. X86-AVX Feature Extensions
      4. X86-AVX Instruction Set Overview
        1. Promoted x86-SSE Instructions
        2. New Instructions
        3. Feature Extension Instructions
      5. Summary
    23. Chapter 13: X86-AVX Programming - Scalar Floating-Point
      1. Programming Fundamentals
        1. Scalar Floating-Point Arithmetic
        2. Scalar Floating-Point Compares
      2. Advanced Programming
        1. Roots of a Quadratic Equation
        2. Spherical Coordinates
      3. Summary
    24. Chapter 14: X86-AVX Programming - Packed Floating-Point
      1. Programming Fundamentals
        1. Packed Floating-Point Arithmetic
        2. Packed Floating-Point Compares
      2. Advanced Programming
        1. Correlation Coefficient
        2. Matrix Column Means
      3. Summary
    25. Chapter 15: X86-AVX Programming - Packed Integers
      1. Packed Integer Fundamentals
        1. Packed Integer Arithmetic
        2. Packed Integer Unpack Operations
      2. Advanced Programming
        1. Image Pixel Clipping
        2. Image Threshold Part Deux
      3. Summary
    26. Chapter 16: X86-AVX Programming - New Instructions
      1. Detecting Processor Features (CPUID)
      2. Data-Manipulation Instructions
        1. Data Broadcast
        2. Data Blend
        3. Data Permute
        4. Data Gather
      3. Fused-Multiply-Add Programming
      4. General-Purpose Register Instructions
        1. Flagless Multiplication and Bit Shifts
        2. Enhanced Bit Manipulation
      5. Summary
    27. Chapter 17: X86-64 Core Architecture
      1. Internal Architecture
        1. General-Purpose Registers
        2. RFLAGS Register
        3. Instruction Pointer Register
        4. Instruction Operands
        5. Memory Addressing Modes
      2. Differences Between X86-64 and X86-32
      3. Instruction Set Overview
        1. Basic Instruction Use
        2. Invalid Instructions
        3. New Instructions
        4. Deprecated Resources
      4. Summary
    28. Chapter 18: X86-64 Core Programming
      1. X86-64 Programming Fundamentals
        1. Integer Arithmetic
        2. Memory Addressing
        3. Integer Operands
        4. Floating-Point Arithmetic
      2. X86-64 Calling Convention
        1. Basic Stack Frames
        2. Using Non-Volatile Registers
        3. Using Non-Volatile XMM Registers
        4. Macros for Prologs and Epilogs
      3. X86-64 Arrays and Strings
        1. Two-Dimensional Arrays
        2. Strings
      4. Summary
    29. Chapter 19: X86-64 SIMD Architecture
      1. X86-SSE-64 Execution Environment
        1. X86-SSE-64 Register Set
        2. X86-SSE-64 Data Types
        3. X86-SSE-64 Instruction Set Overview
      2. X86-AVX Execution Environment
        1. X86-AVX-64 Register Set
        2. X86-AVX-64 Data Types
        3. X86-AVX-64 Instruction Set Overview
      3. Summary
    30. Chapter 20: X86-64 SIMD Programming
      1. X86-SSE-64 Programming
        1. Image Histogram
        2. Image Conversion
        3. Vector Arrays
      2. X86-AVX-64 Programming
        1. Ellipsoid Calculations
        2. RGB Image Processing
        3. Matrix Inverse
        4. Miscellaneous Instructions
      3. Summary
    31. Chapter 21: Advanced Topics and Optimization Techniques
      1. Processor Microarchitecture
        1. Multi-Core Processor Overview
        2. Microarchitecture Pipeline Functionality
        3. Execution Engine
      2. Optimizing Assembly Language Code
        1. Basic Optimizations
        2. Floating-Point Arithmetic
        3. Program Branches
        4. Data Alignment
        5. SIMD Techniques
      3. Summary
    32. Chapter 22: Advanced Topics Programming
      1. Non-Temporal Memory Stores
      2. Data Prefetch
      3. Summary
    33. Index