This volume examines the Application Binary Interface (ABI) as the precise and enforceable agreement governing how C and C++ programs interact with handwritten assembly at the binary level on Linux x86-64.

It explains:

  • How functions exchange data
  • How compilers construct stack frames
  • How registers are classified and preserved
  • How object files are linked into fully executable systems

The primary objective is to demonstrate how handwritten assembly can interoperate seamlessly with compiler-generated code without relying on external runtime libraries.

This interoperability requires strict compliance with the following rules defined by the System V AMD64 ABI:

  • Register conventions
  • Function return mechanisms
  • Stack alignment requirements
  • Calling conventions
  • Register preservation rules

Scope

This book provides a structured progression from ABI fundamentals to fully interoperable low-level components.

Topics include:

  • Register usage, calling conventions, and stack discipline
  • Integration of standalone assembly modules with C and C++ programs
  • Global Offset Table and Procedure Linkage Table mechanics
  • Dynamic linking internals
  • Inline assembly constraints
  • Performance-tuning techniques
  • Pure assembly routines linked directly with C++

The final project consists of pure assembly mathematical and data-processing routines integrated directly with a C++ program.

All examples:

  • Use Intel assembly syntax
  • Target the 64-bit x86-64 architecture
  • Rely on direct Linux system calls
  • Use standard GNU toolchains
  • Run on modern Linux systems

The code is assembled and linked using common GNU development tools.

Relevance

In the post-2020 toolchain and security landscape, ABI mastery is no longer optional.

It is essential for:

  • Building secure, position-independent executables
  • Supporting Position-Independent Executable requirements
  • Maintaining compatibility with modern security protections
  • Supporting Control-flow Enforcement Technology
  • Supporting Shadow Stack protection
  • Maintaining consistent cross-language linkage
  • Interoperating correctly with GCC, Clang, and LLVM
  • Designing high-performance, assembly-accelerated routines
  • Integrating low-level routines safely into modern C++ applications

Philosophy

This work treats the ABI not as passive documentation, but as a language of execution.

It is the formal contract binding:

  • Software layers
  • Compilers
  • Linkers
  • Operating systems
  • Assembly modules
  • The processor itself

The ABI defines the exact boundary where abstraction ends and machine execution begins.

By mastering this contract, developers gain precise control over:

  • Performance
  • Cross-language interoperability
  • Binary compatibility
  • Register usage
  • Stack behavior
  • Long-term binary stability

Every instruction in this book adheres strictly to ABI rules because, in professional low-level Linux programming, precision itself is the interface.