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)?
Programming from the Ground Up
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/
精彩评论