
Zen of assembly language
by Michael Abrash · first published 1990
15mentions
6recommended by
10HN commenters
2010–2025first – last mentioned
60% recommend40% neutral
Why HN recommends it
Deep, practical look at x86 assembly performance tuning from the DOS era, including the Zen Timer for measuring code speed; often recalled fondly and still valued for its low-level optimization insight.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.


…frame-rates up to 60 FPS. 2. Audio rates to 45kHz. 3. 16 colors through composite artifacting. 4. Simultaneous color and B&W output. On a related note, you will probably be interested in Michael Abrash's Zen of Assembly Language. From the "README.md": "This is the source for an ebook version of Michael Abrash's Zen of Assembly Language: Volume I, Knowledge, originally published in 1990. Reproduced with blessing of Michael Abrash,…
on “8088 Domination Post-Mortem, Part 1” ↗You might be thinking of "Zen of Assembly Language" or "Zen of Code Optimization" by the brilliant Michael Abrash. I own the latter and in addition to plenty of low-level code optimization advice for the microprocessors available at the time it also includes…
on “Ask HN: How were video games from the 90s so efficient?” ↗…example, check out Chapter 22 [1] from his Graphics Programming Black Book entitled Zenning and the Flexible Mind for a pleasant stroll down Optimization Lane. You might also enjoy his book entitled The Zen of Assembly Language which features the Zen Timer (a timing tool for performance measuring). [1] http://downloads.gamedev.net/pdf/gpbb/gpbb22.pdf
on “Hello. I'm a compiler” ↗Hopefully everyone on HN knows who Michael Abrash is AND has a copy of "Zen of Assembly Language."
on “Introducing Michael Abrash, Oculus Chief Scientist” ↗Michael Abrash! Wow, this brings back some found memories, as reading Zen of Assembly Language.
on “Quake's 3-D Engine: The Big Picture by Michael Abrash (2000)” ↗It is now about 20 years old, but you can start with "Zen of Assembly Language" and carry on with "Graphics Programming Black Book". https://github.com/jagregory/abrash-zen-of-asm https://github.com/jagregory/abrash-black-book
on “I translated a simple C program to x86_64 and it was slower” ↗A fascinating peek into the fairly deep past (sigh) is Abrash's The Zen of Assembly language. Time pretty much overtook a planned Volume 2 but the Volume 1 is still a pretty fascinating read for a time when tweaking optimization for pre-fetch queues and the like was still a thing.
on “Assembly Optimization Tips by Mark Larson (2004)” ↗…when optimizing compilers taking advantage of UB started being common thing, during the 8 and 16 bit home computer days they were hardly any better than writing Assembly by hand, hence why books like Zen of Assembly Language left such a mark. So if we are speaking of optimizing compilers there is MLton, while ensuring that the application doesn't blow up in strange ways. The problem is not people getting to learn these…
on “Unexpected productivity boost of Rust” ↗In his book "Zen of Assembly Language", Michael Abrash has a chapter named "Billy, don't be a compiler" and tells the story of a man who coded Assembly like a C compiler. I apologize in advance, but I can't help but extend to you the same…
on “How to avoid the assignment statement” ↗Another interesting book--at least for historical context--is Michael Abrash's Zen of Assembly Language Programming. A lot of the optimizations are a good read if you're into that sort of thing but there's not a lot of practical interest for today. (Abrash in fact never wrote the Volume 2 he was planning…
on “The Art of Assembly Language Programming (1996)” ↗Zen of Code Optimization 1994 ( https://www.amazon.com/Zen-Code-Optimization-Ultimate-Softwa...) is the follow up to Zen of Assembly Language 1990 (https://www.amazon.com/Zen-Assembly-Language-Knowledge-Progr...)
on “An optimization guide for assembly programmers and compiler makers (2018) [pdf]” ↗That made me smile, thanks. [1] [1] 'Zen of Assembly Language', Michael Abrash
on “Introducing Michael Abrash, Oculus Chief Scientist” ↗…a proper BASIC compiler for MS-DOS like PowerBasic, nee TurboBasic, with the right set of compiler flags. Naturally it would also have its share of inline Assembly, just like Doom, as every owner of "Zen of Assembly Language" first edition knows that C and C++ compilers for MS-DOS weren't the speed daemons developers nowadays taken them for. You should spend some time learning how AMOS used to be loved on the Amiga Demoscene…
on “Java's Magic Sauce” ↗…Kindle. FWIW, these conversions were done with an eye for preserving an interesting piece of gaming/graphics programming history, and aren't really intended to be relevant today. I also converted the Zen of Assembly Language also by Abrash[1], but it's considerably less relevant than the Black Book in general. [1] https://github.com/jagregory/abrash-zen-of-asm
on “Black Book of Graphics Programming, Special Edition (1997)” ↗…old enough to remember when C, Modula-2, Basic and Turbo Pascal, AMOS were the "Unity" of MS-DOS/Amiga, because for this kind of tasks there's nothing better than Assembly and everyone had a copy of Zen of Assembly Language. Then the speech was updated to there's nothing better than C when compilers improved, and it took PS 2 with its C++ SDK to eventually force game devs to grudgingly accept C++. Which now reigns on…
on “Is Rails still relevant in 2018?” ↗