decade about graphics and performance programming that’s still relevant to Code Optimization is there too, and even my book Zen of Assembly. Graphics Programming Black Book Special Edition has 65 ratings and 3 reviews. — Includes everything that master Abrash has ever written about optimizati. Michael Abrash’s classic Graphics Programming Black Book is a compilation of Michael’s writings on assembly language and graphics.

Author: Tygora Zuran
Country: Portugal
Language: English (Spanish)
Genre: Career
Published (Last): 15 January 2011
Pages: 437
PDF File Size: 18.15 Mb
ePub File Size: 14.35 Mb
ISBN: 951-2-98467-903-5
Downloads: 71843
Price: Free* [*Free Regsitration Required]
Uploader: Vijas

Parallel Processing with the VGA 2.

Examine it, question it, and improve upon it, for an inquisitive, skeptical mind is an important part of the Zen of assembly optimization. One obvious effect of the 8-bit bus cycle-eater is that word-sized accesses to memory operands on the take 4 cycles longer than byte-sized accesses.

Graphics Programming Black Book | Dr Dobb’s

About the Authors No one has done more to conquer the performance limitations of the PC than Michael Abrash, a software engineer for Microsoft. Instruction fetches rarely wait in an based PC because system memory is zero-wait-state. Zen of Assembly Language: Focus on making the inner loop—the code that handles each block—as efficient as possible, then structure the rest of your code to support the inner loop. We need the interrupt generated by the output of timer 0 to tell us when the count has overflowed, and we will see shortly that the timer interrupt also makes it possible to time much longer periods than the Zen timer shown in Listing 3.

Knowledge makes that possible, but your programming instincts make it happen. The closest match to what we need is strstrwhich searches one string for the first occurrence of a second string. I bought a lot. That can be irritating; I once spent a good hour tracking down a bug caused by my unconscious assumption that NOT does set the flags. I have the Black Book as well, good memories!

I emailed Denthor once and thanked him shortly after I got my first job in ‘ While I agree it’s dated in lot of ways but it is still a great read. PCs can work wonders.


Follow the Author

By the way, there is, to the best of my knowledge, no such problem with Bkack up through version 5. AmazonGlobal Ship Orders Internationally.

ZTimerOn saves the context of the calling code, disables interrupts, sets timer 0 of the to mode 2 divide-by-N modesets the initial timer count to 0, restores the context of the calling code, and returns. If you want to set PS2 to 0, it would be a good idea to time a few of the listings in this book with PS2 set first to 1 and then to graphjcs, to make sure that the results match. A final approach is to modify ZTimerReport to print the result to the auxiliary output via DOS function 4, and to then write and load a special device driver named AUXto which DOS function 4 output would automatically be directed.

Most of these are very easy to pick up by just reading one of the many online tutorials. In all seriousness, this book has been my bible for software engineering efficiency and graphics programming.

The translation programmng also surely responsible for the sappy lyrics; dollars to donuts that the original French lyrics were stronger.

Graphics Programming Black Book Special Edition by Michael Abrash

All this is grapgics a way of saying: In short, Listing 1. Invoking memcmp for each potential match location works, but entails considerable overhead. His complete works are contained in this massive volume, including everything he has written about performance coding and real-time graphics. Given that your code and data reside in normal system memory below the K mark, how great an impact does the display adapter cycle-eater have on performance?

He actually made the point right in the book that the code prograkming obsolete from a use perspective. Each comparison requires that parameters be pushed and that a call to and return from memcmp be performed, along with a pass through the comparison loop.

Theoretically, this enables measurement of arbitrarily long periods. I was a little worried I would need to be a guru to make any sense of this book.


The assembly language implementation is indeed faster than any of the C versions, as shown in Table 1. Altering the Zen timer for linking to a small code model C program involves the following steps: The effect of the code preceding an instruction on the execution time of that instruction makes the Zen timer trickier to use than you might expect, and complicates the interpretation of the results reported by the Zen timer. After all, every other arithmetic and logical instruction sets the flags; why not NOT?

Whichever perspective you prefer is fine.

Graphics Programming Black Book Special Edition

The PC jr had an running at 4. We need to read the two time components simultaneously in order to get a clean reading.

He had assumed that the information available to him was both correct and complete. In my experience, this approach works beautifully with fully compatible chips. For starters, DOS functions are invoked with interrupts, and interrupts are among the slowest instructions of the x86 family CPUs. Fans of the call it a bit processor.

If PS2 is 1 as it is in Listing 3. As diligent as the author had been, he had nonetheless committed a cardinal sin of x86 assembly language programming: Due to the nature of these files, we were unable to remove the link.

You should not use the long-period Zen timer to time code that requires interrupts to be disabled for more than 54 ms at a stretch during the timing interval, since when interrupts are disabled the long-period Zen timer is subject to the same 54 ms maximum measurement time as the precision Zen timer.