3

I am trying to learn assembly, and finding proper documentation is really hard. It really makes me appreciate PHP and Java's documentation <3. I cannot quite find a good book or resource for inline assembly in C using AT&T syntax. I am looking for that one resource that has everything about assembly. Could anyone please suggest some books or resources for me to learn everything about assembly (at least most of it)?

Strawberry
  • 66,024
  • 56
  • 149
  • 197
  • 1
    For learning assembly I always recommend The Art of Assembly Language (16 bit edition)", by mr. Hyde. It's a really good book, it has everything about assembly in general, but nothing about inline assembly. – BlackBear Apr 21 '11 at 19:51

2 Answers2

3

Programming from the Ground Up

karlphillip
  • 92,053
  • 36
  • 243
  • 426
1

First of all: Read object code. Compile some C program you have written using '-O3 -g', and check the object code using 'objdump -S yourprogam|less'. Try to find the optimization opportunities you compiler left out ;-)

Regarding AT&T syntax and inline assembly:

http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

Read Agner Fogs stuff regarding optimization, somewhat advanced, but incredibly useful if you really want to find out where you can squeeze out some cycles: http://www.agner.org/optimize/

For the instruction set: http://www.sandpile.org/

and of course http://www.intel.com/design/intarch/manuals/243191.htm

Some general introductions about writing assmebly, somewhat dated but useful for windows too:

http://www.linuxdoc.org/HOWTO/Assembly-HOWTO/

Gunther Piez
  • 29,760
  • 6
  • 71
  • 103