Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Randall Hyde

Rating No ratings yet

No magic. No shortcuts. No runtime to blame. You can ask an AI to explain how vtables work in x86. It will give you something that sounds right. What it won’t give you is what Windows actually expects the vtable to look like, why method dispatch behaves the way it does at the instruction level, or what breaks when you deviate from convention. This volume of The Art of 64-Bit Assembly closes the gap between a plausible explanation and genuine understanding. Every chapter takes a construct you’ve used in C++, Python, or Rust, strips away the runtime, and rebuilds it from scratch in MASM, running under Windows. Objects, exceptions, closures, coroutines, concurrency: Each is dissected at the instruction level, with every decision made visible and explicit. What you’ll build Object-oriented programs in MASM: vtables, method dispatch, and inheritance, from scratch by hand Windows structured exception handling (SEH) installed and managed at the instruction level Thunks, closures, and iterators that behave like higher-order functions Coroutines, generators, and fibers without resorting to HLL code Concurrent programs with real synchronization primitives, directly from assembly Unicode string handling done correctly, at the level where most code gets it wrong Domain-specific macro languages inside MASM, built from first principles If you already know assembly and want to stop taking the hard parts on faith, this is the book.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide that rebuilds the machinery behind modern programming—objects, exceptions, closures, coroutines, and threads—directly in MASM on Windows, so you can see exactly what the runtime normally hides. Read it if you already know x86-64 assembly and want to stop taking the hard parts on faith. 【Book Arc】 - **Opening (~0%–10%)**: Sets expectations and prerequisites, then moves into advanced macro programming and Unicode string handling—the tooling and text foundations later chapters depend on. - **Early (~10%–30%)**: Covers transcendental math via the FPU, advanced procedure mechanics (lexical nesting, static links, displays, parameter-passing schemes), and the start of concurrent programming with Windows threads and synchronization primitives. - **Middle (~30%–55%)**: The object-oriented core: classes, virtual method tables, method dispatch, inheritance, multiple inheritance and the diamond problem, plus a macro toolkit for declaring MASM classes. - **Late (~55%–80%)**: Exception handling—Windows structured exception handling, stack unwinding, and how exceptions interact with iterators and coroutines. - **Ending (~80%–100%)**: Higher-order and control-flow constructs: iterators, coroutines, generators, fibers, fiber-local storage, and the closing reference appendices. 【Key Takeaways】 - **The book is about programming, not optimization** (Early): Hyde explicitly defers optimization to a future volume; the goal here is understanding constructs, not squeezing cycles. - **Objects are just data plus function pointers** (Middle): vtables, the `this` pointer, and dispatch are built by hand, exposing what C++ compilers actually emit and what Windows expects. - **Exception handling is stack mechanics** (Late): SEH is installed and managed at the instruction level, making unwinding a concrete, traceable operation rather than a language feature. - **Concurrency needs real primitives, not abstractions** (Early): Critical sections, events, mutexes, semaphores, atomic instructions, the lock prefix, and memory fences are all presented directly. - **Higher-order behavior is achievable in assembly** (Ending): Thunks, closures, iterators, coroutines, generators, and fibers are implemented without resorting to HLL code. - **Unicode is where most code gets it wrong** (Opening): String handling is treated as a correctness problem at the byte level, not a library call. - **MASM macros are a language of their own** (Opening/Middle): Advanced macro programming and domain-specific macro languages are built from first principles, including the class-declaration macros. - **Prerequisites are real** (Early): The book assumes Volume 1 or equivalent MASM/Visual Studio fluency; examples build on prior library code. 【Reading Tips】 - Deep-read the OOP and exception chapters (Middle–Late); these are the conceptual payoff and the hardest to reconstruct from memory. - Skim the transcendental-function chapter if you don't need FPU math—it's self-contained and detailed. - Keep MASM and Visual Studio open; the listings are compilable and the build commands are given, so type and run rather than just read. - Treat the macro chapters as reference material you'll return to when building your own class or iterator macros. - Watch the typography conventions (registers in caps, logic functions vs. instructions) to avoid misreading prose as code. 【Coverage Limits】 The excerpts cover the table of contents, introduction, and front matter thoroughly, but do not include the actual body text of most chapters, so specific code examples and detailed explanations are not summarized here.
Excerpt 1
ed Programs I.5 Typography and Pedantry 1 ADVANCED MACROS 1.1 An Introduction to Domain-Specific Languages 1.2 A Review of the MASM Macro Declaration 1.2.1 M...
View in text
Excerpt 2
SING VISUAL STUDIO C.1 Installing Visual Studio Community C.2 Creating a Command-Line Prompt for MASM C.3 Editing a MASM Source File INDEX The Art of 64-Bit...
View in text
Excerpt 3
nguage (and C/C++) source code appears throughout this book. Typically, source code comes in three flavors: code snippets, modules, and full-blown programs....
View in text
Excerpt 4
n if that text appears in the middle of an English sentence. In particular, variable and procedure function names are usually set in monospaced font. This bo...
View in text
Excerpt 5
one of your macros, you’re using one of your DSL statements. When you drop back into assembly language (between the macro invocations), you’re in the fallbac...
View in text
Excerpt 6
rbitrary numeric constant expression to appear after the % . Therefore, you can also use the % operator thusly: txt3 textequ %'A'-1 ; txt3 becomes 64. One of...
View in text
Excerpt 7
t requires that you supply a label for the macro invocation. You can invoke the original drctv macro with drctv 2 and MASM will correctly expand this as foll...
View in text
Excerpt 8
t to text (see the textequ directives in this example). 1.4.2 The MASM instr Directive The instr directive and function search for the presence of one string...
View in text
Tags
AI categories
Programming LanguageGoSoftware
ISBN: 1718504349
Publish Year: 2026
Language: English
Pages: 807
File Format: EPUB
File Size: 7.3 MB