Book Review: The Art of Assembly Language, 2nd Edition
Before being able to write a simple "Hello World" program one needs to know a fair deal about the x86 architecture, the assembler language and the operating system. Obviously this is not the case with high level languages such as C for example.

The syntax of HLA can be thought of as a hybrid of Pascal and assembly language. Here's a sample "Hello world" HLA program:
You may argue that this was not an assembly language program, but what about this:program helloWorld; #include( "stdlib.hhf" ); begin helloWorld; stdout.put( "Hello, World of Assembly Language", nl ); end helloWorld;
Although this is also not pure assembler syntax, the newcomer will enjoy learning about the x86 architecture and instruction set with the help of the features provided by HLA:program h; #include("stdlib.hhf"); static s: string := "Hello World!"; procedure chksum_str; @returns( "eax" ); begin chksum_str; mov(s, edi); xor(ebx, ebx); xor(eax, eax); while( mov( [edi], al ) <> #0 ) do inc(edi); // advance str ptr add(eax, ebx); endwhile; mov(ebx, eax); end chksum_str; begin h; stdout.put("The checksum of '", s, " is: 0x"); chksum_str(); stdout.put(eax); if ( eax == 1234 ) then stdout.put("Special chksum!", nl); endif; end h;
- Ability to create user types
- Exception handling
- Control and repetition structures (and other constructs found in high level languages)
- Classes and objects
- Various libaries: stl, file i/o, os, array manipulation, math, etc...
- etc...
For example, in Chapter 5 (Procedures and Units), he explains in detail how the stack is set up during a procedure call, how local variables are allocated and how to access the arguments, followed by explanation on how to use HLA to write procedures. Similarly in Chapter 6, when talking about FPU arithmetics, the author carefully explains about the FPU data and controls registers, related instruction set and finally how to use HLA to do FPU arithmetics.
If your aim is to learn assembly language in order to start reverse engineering, this book is probably not for you, however I highly recommend this book for programmers:- That always wanted to learn the x86 assembly language but found it difficult to start with. This book is well organized and easy to read
- That want to teach the basics of the x86 architecture and assembly language
- That want to put together an x86 assembly program quickly. HLA compiler and the built-in libraries give you the convenience of a high-level programming language and the power of a low level language. If you use the standard libraries provided by HLA then your program is portable

The IDA Pro book
Comments
"If your aim is to learn assembly language in order to start reverse engineering, this book is probably not for you..."
That begs the question; is there a book you'd recommend for folks wanting to learn assembly for the purposes of starting to reverse engineer closed-source binaries?
Posted by: mish | April 29, 2010 05:28 PM
mish: Yes, same book, just skip the HLA chapters.
Posted by: Jason | April 29, 2010 07:31 PM
I don't think any assembly books exist with a sole focus on reversing.
But I'd recommend x86 Assembly by Richard C. Detmer, plus a few books on Reversing/Malware/Security.
Once you learn the basic assembly concepts, you will be able to start applying this to some basic reversing but the best way to learn reversing is to simply - do it, over & over.
Its going to be an ongoing thing, no one book will teach you everything.
Posted by: vulnski | April 29, 2010 10:04 PM
@mish: I expected this question, but the reason I did not suggest any RE book is because I did not learn reversing from books.
As @vulnski suggested. First learn assembly language (be it books, internet, etc...), learn high-level programming (such as C/C++ or Delphi) and learn the target operating system's APIs. With this combined knowledge all that is left to be done is to simply practice and learning more along the way.
@Jason: I haven't seen the 1st edition, but in this 2nd edition all chapters involve HLA. While he cannot skip chapters, he can read each chapter and learn the concepts. As said before, concepts are nicely explained and easy to grasp.
Posted by: Elias Bachaalany
|
April 30, 2010 09:12 AM
Thank you all for the thoughts. I more just didn't want the question "how to start reading assembly for reversing" to go unanswered and figured there would be good conversation in the comments. I was not disappointed ;-).
Regards.
Posted by: mish | April 30, 2010 06:35 PM
Hmmmm....
I wonder if Ilfak programs in HLA (pfffft!)
Much likely TASM or C/C variants.
HLA is good. But its NOT assembler. And its confusing students who STUDY Mr. Hyde's courses then go out to face the "real-world" assembler applications....
One wonders if industrial machines and NASA uses HLA.
My two cents review: stay away from this junk.
Hmmm... Peace.
Have Phun
Posted by: Aimless | May 7, 2010 07:54 PM
@Aimless: No, here at Hex-Rays we do not use HLA. We have a few components that use the assembler and apart from that we only use C/C++
Posted by: Elias Bachaalany
|
May 10, 2010 11:50 AM