The Art of Assembly Language

by
Randall Hyde

Review by Michael Morin
MELUG-Central A division on MELUG, the Maine Linux User Group

Introduction

In the age of 3GHz+ 64-bit machines sitting on your desk, where many of us have more cycles to burn than we know what to do with, why would anyone want to learn assembly language? It's true, Assembly Language is not as useful as it once was; optimizing C compilers, JIT compilers and fast interpreters, combined with the abundance of cycles put the final nail in the coffin of Assembly Language for the average programmer. But in the end, human beings can still write faster, smaller code than compilers. It's also vital to know assembly language to understand how your compiler works, you can't understand how C really works without it.

The Art of Assembly Language (called AOA for short) takes a from the ground approach teaching how to write complete programs in Assembly Language. In contrast, most other books on assembly language spend most of their time teaching you the intricacies of a particular architecture, rather than teaching you how to actually make something practical. To avoid involved discussion on computer architecture, a pseudo-language, HLA (High Level Assembly), is used. This allows the reader to focus on what's really important, writing programs without hitting the proverbial brick wall that dooms many who attempt to learn assembly language to failure.

Don't let this HLA detail fool you, AOA doesn't shield you from computer architecture, far from it. You will learn everything from the principals of the Von Neumann architecture to modern paged addressing schemes. HLA eases you into this by providing routines to print to the screen, read from the keyboard, and even high-level control structures (if, while, for, etc), slowly replacing these high-level aspects with "straight assembly" throughout the book. Despite negative feedback, HLA was a well-conceived learning tool and does it's job; no one expects you to continue using it after you're finished with the book.

Comments

At first glance, AOA is an intimidating 900 page tome of arcane knowledge. This couldn't be further from the truth. Yes, AOA is long, but for good reason. Topics are discussed in detail and no stone is left unturned. Topics are not glanced over, you are not refered to other materials, everything you need is right there. That being said, this isn't a book you're going to be able to get through quickly, if you haven't encountered the topics presented, it'll take time to take it all in. Computers are, after all, some of the most complex machines ever created (at least by humans).

What this book isn't is a reference of x86 instructions. HLA is nearly identical to x86, but when you're ready to move on to "real" assembly programming, you have to learn a number of things all over again. This is the price for easing into assembly programming, the alternative is diving into the nearly vertical learning curve of straight assembly programming. Also, Intel gives its documentation away for free, even printed versions, so you won't be spending any more money on Intel-specific reference material.

Sometimes I'd rather see some short discussions, rather than 50 page chapters. If I'm interested in knowing a bit about the FPU, but not interested in actually using it, I have to wade through the "boring" details. This is not the book if you want short explanations. Though long, there is a lot of code and plenty of diagrams to help things along. Everything is layed out nicely and pleasing to the eye as well, a lot of work went into the layout (as is the case with many No Starch books).

Conclusion

AOA is not a light read, to say the least. If you're not intending to actually write entire programs in assembly language, AOA might not be the best choice. AOA is a lot easier to grasp than trying to read the Intel manuals without previous experience though, so it's a good place to start.