Convert C to MIPS64 Assembly

I have written some code in C and need to convert this to MIPS 64, with and without optimisation. I have been trying to convert this with gcc but this converts it to x86 which is far more complex. Furthermore, I have been trying to find a cross compiler but have not been able to get any compiler to work. Any help and suggestions will tremendously be appreciated.

Kind regards,


After downloading and installing Codesourcery codebench for MIPS, invoke the MIPS gcc cross compiler for the MIPS 64 revision 2 architecture as follows:

C:Program Files (x86)CodeSourcerySourcery_CodeBench_Lite_for_MIPS_GNU_Linuxbinmips-linux-gnu-gcc -march=mips64r2 foo.c -S

This generates MIPS assembly source code in foo.s .

The documentation that was installed with codebench will tell you the other possible values for the -march option. Other gcc flags like -S and -O work as normal.


If you use a MIPS cross compiler, instead of a gcc that targets x86, you can complete this "conversion" (compilation). If you need to find a MIPS cross compiler (gcc), you can get one pre-built from codesourcery.com

The wording in your question seems to suggest you don't care as much that the output is MIPS, but rather you want the output to be less complex than x86. If this is the case, you might also examine the ARM output.

链接地址: http://www.djcxy.com/p/19208.html

上一篇: MIPS存储字节和存储半字实现

下一篇: 将C转换为MIPS64汇编