Easy way to convert c code to x86 assembly?

前端 未结 9 1739
礼貌的吻别
礼貌的吻别 2021-01-30 23:44

Is there an easy way (like a free program) that can covert c/c++ code to x86 assembly?

I know that any c compiler does something very similar and that I can just compile

9条回答
  •  时光说笑
    2021-01-31 00:17

    Your compiler is already doing that as you've stated, and most likely will have an option to stop before assembling.

    For GCC, add the -S flag.

    gcc -S x.c
    cat x.s
    

    Edit: If your program is pretty short, you could use the online service at https://gcc.godbolt.org/.

提交回复
热议问题