开发者

Where can I find resources to learn inline assembly in C using AT&T syntax? [closed]

开发者 https://www.devze.com 2023-02-28 03:29 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this quest开发者_开发技巧ion will likely so
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this quest开发者_开发技巧ion will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消