Learning to read GCC assembler output

前端 未结 6 1387
长情又很酷
长情又很酷 2021-01-30 01:03

I\'m considering picking up some very rudimentary understanding of assembly. My current goal is simple: VERY BASIC understanding of GCC assembler output when co

6条回答
  •  青春惊慌失措
    2021-01-30 01:40

    If you're using gcc or clang, the -masm=intel argument tells the compiler to generate assembly with Intel syntax rather than AT&T syntax, and the --save-temps argument tells the compiler to save temporary files (preprocessed source, assembly output, unlinked object file) in the directory GCC is called from.

    Getting a superficial understanding of x86 assembly should be easy with all the resources out there. Here's one such resource: http://www.cs.virginia.edu/~evans/cs216/guides/x86.html .

    You can also just use disasm and gdb to see what a compiled program is doing.

提交回复
热议问题