Okay, I'll take a little time to brag. The word count challenge here got my interest at the time, so I whipped up an assembly language version of it and iterated several times, trying to figure out the value of switching different registers. In the end, I took second place:<p><a href="https://github.com/jagregory/abrash-black-book/blob/4028269fe1f847f81dfae21bf01b185fecbb9075/src/chapter-16.md" rel="nofollow">https://github.com/jagregory/abrash-black-book/blob/4028269f...</a><p>However, there's an interesting story behind this story. David Stafford, who came in first, posted that he thought he had the fastest solution and bet $100 that nobody could beat it. I posted my code which was significantly faster, and David tweaked it further to eventually win the challenge. Like a true person of honor, he did pay the $100 and I cashed his check.
I knew from the title it was going to be Michael Abrash's book. There is, indeed, a lot of wisdom there. I did most of my recreational x86 assembler coding in 1993-95. I got the book when it came out (an unwieldy tome in paper form) and poured over it but, sadly, I never really did much x86 assembler after that.<p>There's a lot in the book that's dated, being very VGA-specific, or specific to the x86 CPUs of that day. Even so, there are lots of ideas in the book that transcend that. His advice about optimization, and about how to approach problems, is timeless.
Ah, yeah, writing Wu antialias line drawing routines in assembly with DOS debug on my PC XT. Those were the days.<p><a href="https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm" rel="nofollow">https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm</a><p><a href="https://en.wikipedia.org/wiki/Debug_(command)" rel="nofollow">https://en.wikipedia.org/wiki/Debug_(command)</a><p><a href="https://en.wikipedia.org/wiki/IBM_Personal_Computer_XT" rel="nofollow">https://en.wikipedia.org/wiki/IBM_Personal_Computer_XT</a>
Although I have heard a lot about the "Don't opimize if you don't need it" or many lines that are similar to this. I also heard from somewhere (maybe it was HN) that modern programmers do not spend enough time on optimization. Half because their education is more and more far away from low level and half because modern software is becoming too complex and they don't have time to optimize much.<p>What's your thought on this?
Michael Abrash is one of the most pragmatic and clear programmers I've ever seen in my lifetime. Not only is he incredibly smart, but he has a communication style that is by far one of the greatest in technical manuals.<p>I didn't realize that the physical black book was so expensive these days. I sure hope I kept my copy.
This book gets posted at least once a year, and I don’t even mind. Such a gem. Besides the more general advice on programming and optimization that is still relevant, the stuff at the end on the development of Quake is a really fun read.
The graphics community remains one of the most intense optimization-based programmers I've ever seen.<p>GPU Gems, ShaderX, GPU Pro, GPU Zen... there's so much optimization to be learned from them.
I'm shocked that this book is so rare (and going for $200!).<p>I have it on my shelf (w/ cd!).
I bought it out of a bargain book bin from a computer store I worked at.<p>It helped me write a 3d engine.
Nice. I own the actual book itself. It is seriously hardcore. It always weighs a ton. I had no idea it was rare and/or worth anything. Also own the related Zen of Graphics Programming book by Abrash.