Mstation.org

Randal Hyde, The Art of Assembly Language, No Starch Press

Back in the old days of things such as Z80 processors I really wanted some assembler information to speed up some things I was doing. Where I was, the information was very hard to get and, as far as I know, there weren't any helpful texts around. And the web wasn't around either.

Now is a different story. This big book (903 pages plus a CD) is a very complete treatment which looks at the 80x86 processor.

Assembly is a very low level language. It is ideal for speeding up libraries or doing very platform specific things. In the early days of computer games for example, it was the only way to squeeze extra juice out of aenemic little processors with not much memory. Assembly is still used to extend capabilities but not as much. If you want a book that explains all this in the context of building a whole machine, look for Tracy Kidder's "Soul of a New Machine" which was about building a Data General (I think) mini some years back.

In this book we're introduced to something called HLA (High Level Assembly) which introduces some programme control features not seen in the lower version. There is a compiler provided and the examples of use provided are under Windows and Linux.

The first lesson you learn in flicking through before settling down is that you need to write a fair bit of code to do anything meaningful. The Hello World example used to start isn't a great example as it's about the same length as C but moving numbers or drawing pictures is a different story, even with HLA. So, the real gain you require will require some real work.

And this book takes you through it in a patient and thorough way - data representation, memory access and organization, constants variables and types, proceedures, arithmetic, control structures, files, and more.

On the way through there are interesting and relevant asides. For example, with the speed of CPU's outpacing that of memory, table- lookups might not be faster than using machine instructions. This is fun stuff if you want to be at this level of the machine. And if you don't, I guess it's doubtful that you'll have read this far.

Here are some questions we asked the author ...

What are people using assembler for these days?

Writing compact applications (assembly apps are generally 1/2 to 1/10th the size of applications written in C). Writing faster applications (generally two to ten times faster).

Though today's machines are fast and have considerable memory, writing efficient programs is a point of pride among assembly programmers. It's their way of saying "I'm not willing to take shortcuts; I want to create the best possible applications for my users."

Are there any particular instances of needing MASM instead of HLA that you can think of?

Writing 16-bit applications. HLA only support 32-bit flat model coding. So if you want to write 16-bit DOS applications, you have to use MASM.

If you're looking to write assembly for, say, an ARM processor, where would you head first for information?

http://www.arm.com

For someone reading your book, and treating it as a course, how long would you recommend they allow to do it properly?

When I've taught the course, I was limited to 10 weeks. However, for someone studying this on their own, I'd probably allow myself an average of two weeks per chapter. Sure, you could treat it as "learn assembly in 24 hours..." But to *really* learn this material, it's best to take it slowly. To pace one's self, I'd suggest that the earlier chapters could be done in a couple of days each, the later chapters will take more time. The most important thing, however, is to write several programs (on the reader's own, not simply copying examples out of the book) for each chapter, touching on the material presented in the chapter. This is where most of the time will be spent.

Thanks Randy.

Back to top

Bookmark:

post to Delicious Digg Reddit Facebook StumbleUpon

Recent on Mstation: music: Vivian Girls, America's Cup, music: Too Young to Fall..., music: Pains of Being Pure At Heart, Berlin Lakes, music: Atarah Valentine, Travel - Copenhagen, House in the Desert

front page / music / software / games / hardware /wetware / guides / books / art / search / travel /rss / podcasts / contact us


M station is free. Making it happen isn't. If you'd like to have a warm fuzzy feeling, why not donate something?