C / C ++到MIPS汇编

问题描述 投票:3回答:1

我知道要编译到汇编,我应该使用-Stion与gccg++,但我如何获得MIPS汇编?

我试过了

g++ -march=mips2 dll.c 

但这给出了错误

dll.c:1:0: error: bad value (mips2) for -march= switch

我看到了编译命令mips_gcc的建议,但我找不到如何安装该编译器。

我正在使用Ubuntu 64位,如果这有帮助的话。

gcc compilation mips
1个回答
5
投票

你需要一个版本的gcc,它是作为MIPS cross compiler构建的。您可以从here下载免费的Mentor / Codesourcery MIPS gnu / gcc交叉编译工具链。此工具链适用于Windows和Linux。

下载,安装并添加工具链到您的路径后,您会说:

mips-linux-gnu-g++ -march=mips32r2 -S dll.c

将代码编译为MIPS32R2程序集。

更新时间:2017年8月:在Mentor网站上看来,MIPS的Sourcery CodeBench免费交叉编译器已经不再可用了。试试Imagination's site的免费工具链。

© www.soinside.com 2019 - 2024. All rights reserved.