From Fundamentals to Advanced Systems Programming
Introduction: The ARM Revolution and Why AArch64 Matters
- From Acorn to Apple Silicon: The ARM Story
- Why Learn Assembly in 2026?
- What This Book Covers and How to Use It
Chapter 1: Architecture Fundamentals
- The Register File: Thirty-One General-Purpose Registers
- Execution States and Modes: AArch64 vs AArch32
- Instruction Encoding and Formats
- Endianness and Byte Ordering
- Comparison with x86-64 Architecture Design
Chapter 2: Addressing Modes and Data Access
- The Load/Store Architecture
- Immediate Offsets and Pre-/Post-Indexed Addressing
- Register-Offset and Shifted Addressing
- Unaligned Access and Endianness Effects
- The AArch64 Memory Model: Weak Ordering Explained
Chapter 3: Integer Operations and the ALU
- Data Processing: Immediate Instructions
- Arithmetic: ADD, SUB, and Their Variants
- Multiplication and Division
- Logical Operations: AND, ORR, EOR, BIC
- Shifts, Rotates, and Bit Manipulation
- Comparison and Set Operations
Chapter 4: Control Flow and Branching
- Unconditional and Conditional Branches
- The Condition Flag System: CZFO vs x86 Flags
- Compare and Branch (CBZ/CBNZ)
- Loop Patterns and Idiom Recognition
- Branch Prediction and Speculative Execution
- Tail Call Optimization and Return Sequences
Chapter 5: Floating-Point and SIMD/NEON
- The FP/SIMD Register File: V0 to V31
- Scalar Floating-Point Operations
- NEON Vector Data Types and Layouts
- Vector Arithmetic and Reduction Patterns
- Data Conversion and Type Casting
- Real-World SIMD Optimization Case Study
Chapter 6: Calling Conventions and the AAPCS64 ABI
- The AAPCS64 Specification Overview
- Register Allocation: Arguments, Temporaries, Preserved Registers
- Stack Frame Layout and Alignment Rules
- Parameter Passing: Integers, Floats, and Structs
- Variadic Functions and Varargs Support
- Interoperation with C, Rust, and Other Languages
Chapter 7: Exception Levels and Privilege Modes
- Four Exception Levels: EL0 through EL3
- Entering and Returning from Exceptions
- System Registers: Configuration and Control
- Interrupt Handling and Vector Tables
- Context Switching at the Assembly Level
- Secure vs Non-Secure World
Chapter 8: Memory Management and Cache Hierarchy
- Virtual Memory and Translation Regimes
- The MMU and Page Table Walks
- TLB Management and Maintenance
- Cache Hierarchy: L1, L2, L3, and Data Caches
- Cache Maintenance Instructions
- Memory Attributes and Access Permissions
Chapter 9: Synchronization and Concurrency
- Atomic Instructions: LDAXR, STLR, CAS Patterns
- Load-Acquire and Store-Release Semantics
- Memory Barriers: DMB, DSB, ISB
- Lock-Free Programming Patterns
- Spinlocks and Mutex Implementation
Chapter 10: Cryptographic Extensions and Advanced Features
- ARMv8 Cryptographic Instructions: AES, PMULL, SHA
- Polynomial Multiplication and GCM Mode
- SHA-256 Hardware Acceleration
- SVE: Scalable Vector Extension Overview
- SVE2: Matrix and Bitmanip Extensions
- Other Extensions: RDM, LSE, DP, MTE
Chapter 11: Performance Tuning and Optimization
- Pipeline Architecture and Instruction-Level Parallelism
- Out-of-Order Execution and Scoreboarding
- Branch Prediction Patterns and Misprediction Costs
- Cache-Friendly Code Layout and Data Access
- Profiling with perf and Hardware Counters
- Real-World Optimization Case Study
Chapter 12: Compiler Interactions and Inline Assembly
- How Compilers Generate AArch64 Code
- GCC Inline Assembly Syntax and Constraints
- Clang/LLVM Inline Assembly and Intrinsics
- Optimization Barriers and Volatile Semantics
- Reading Compiler Output with objdump and llvm-objdump
- When to Use Assembly vs Intrinsics vs Compiler Hints
Chapter 13: Debugging, Reverse Engineering, and Systems Programming
- Debugging with GDB, QEMU, and Hardware Debuggers
- Reverse Engineering AArch64 Binaries
- Common Obfuscation Patterns and Anti-Analysis Techniques
- Syscall Interface: The ARM64 System Call ABI
- Kernel Entry Points and Trap Handling
- Practical Systems Programming Examples
Conclusion: The Future of AArch64 and Beyond
- What You Have Learned: Key Takeaways
- ARMv9 and the Next Generation
- The Server Revolution Continues
- Where to Go From Here
References
Glossary of ARM-Specific Terms
Appendix A: AArch64 Instruction Categories Quick Reference
Appendix B: Linux ARM64 System Call Table (Selected)
Appendix C: Memory Barrier Semantics Quick Reference
Appendix D: AAPCS64 Register Roles Summary
- General-Purpose Registers
- FP/SIMD Registers
- Stack Rules
- Argument Passing Rules
