views:

505

answers:

4

Hello,

I ran a search for assembly language resources on stackoverflow.com and found some interesting results, but they seemed to boil down to two groups: 1) Assembly references to old ia32 architecture, such as the 80386 to Pentium 2) Windows agnostic books.

Most of the commenters make the point that assembler is CPU dependent and that the OS is irrelevant, but it seems pointless to me to pick a book that has assembly examples that refer to MS-DOS interrupts and memory layouts. Likewise, learning assembler on Linux would seem to produce Linux executables

Are there any: 1) Modern 2) x86/x64 3) on Windows platform - book resources available ?

The reason I am targeting the Win platform is I would like to do low-level, OS internals programming, to supplement my Win C/C++ work.

Thanks

+1  A: 

Leiterman's book, while not quite as focused as you wish (he covers several variations around x86 and x64 architectures and systems), is a pretty solid start, I think. I would supplement it with Vostokov's, which IS focused on x64, and on Windows... but also specifically on debugging (once you start writing a lot of assembly code, you WILL spend a lot of your time debugging, after all, so that focus is not a bad idea;-).

Alex Martelli
+2  A: 

In addition to Alex Martelli's answer, I'd also note that there's a 64-bit discussion forum on masm32.com, and that asmcommunity.net do also discuss 64-bit code in their forum. The latter also have an Asm Community (online) Book project on their site, although this currently - sadly - doesn't say too much about Windows x64 development.

PhiS
A: 

The difference between x86-32 and x86-64 is quite small compared to other x86 modes. Most Windows assembly is 32-bit flat protected mode, which can be readily be extended or adapted to x86-64.

I think you shouldn't fret about a lack of x86-64 assembly books, as most people learning assembly are learning using 32-bit flat protected mode, either for Windows or Linux.

I would agree with the idea that 16-bit real segmented mode is primarily obsolete (and a pain to learn), so there is little use to learning it, unless you have a particular need, like the urge to feel macho.

To begin with, there will likely be little difference with 16-bit real flat mode, which limits programs to 64KB of memory, and outputs in the Windows world are .COM only. At the beginning this is not a big limitation, while you are making your first steps. You will likely start writing simple console programs to begin with, simply because they are simpler and shorter. While I wouldn't go out my way to learn 16-bit real flat mode, I wouldn't exclude good material simply because it is DOS based, for your first steps.

Post-Pentium, most of the new x86 instructions were SIMD (single instruction, multiple data) or later Intel 64 / IA-32e / amd64 as far as I know, so I suspect that is why you haven't seen particular reference to newer opcodes. In the beginning this isn't an issue. You'll need to learn to walk before worrying how to run in assembly.

I hope that is useful.

mctylr
A: 

I highly recommend the book Computer Systems A Programmer's Perspective. It's choke full of assembly programming reference compared to C code and the 2nd edition (release just a few weeks ago) go into the difference between IA32 and x86-64 quite a bit in Chapter 3.

Fred Wang