7.12. 7.12 Performance Improvements

The 80×86 microprocessors execute sequences of instructions at blinding speeds. Therefore, you'll rarely encounter a program that is slow and that doesn't contain any loops. Because loops are the primary source of performance problems within a program, they are the place to look when attempting to speed up your software. While a treatise on how to write efficient programs is beyond the scope of this chapter, there are some things you should be aware of when designing loops in your programs. They're all aimed at removing unnecessary instructions from your loops in order to reduce the time it takes to execute one iteration of the loop.

7.12.1. 7.12.1 Moving the Termination Condition to the End of a Loop

Consider ...

Get Art of Assembly Language, 1st Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.