Converting C source to ARM assembly

馋奶兔 提交于 2019-12-04 22:10:10

Any c compiler can generate assembly code from C code, if your objective is specifically to generate assembly code for arm then you'll need a cross compiler such as the GNU arm embedded toolchain.

For gcc on particular you just need to use the -S option when compiling, so the line looks something like:

gcc -S -source.c -o output.s

Of course you'll need to include any headers and include directories for it to compile.

if you simply want to cross compile it, then simply do the full compilation assemblage and linking process. Depending on how low level the c code is it's actually possible for it not to work on the pi 2 (but it will compile)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!