在Linux环境下编译misp指令的具体步骤
发布时间
阅读量:
阅读量
依据《自己动手写CPU》一书提供的指导,在Linux操作系统环境下完成了MIPS GNU工具链的搭建,现将具体的编译流程进行记录。
(一)编写汇编代码 ,如下图所示,inst_rom.s文件中保存了待编译的程序代码:

(二)编译
在该目录中,执行以下命令:
mips-sde-elf-as -mips32 inst_rom.s -o inst_rom.o
成功获取 inst_rom 文件
(三)链接
相关指令:
mips-sde-elf-ld -T ram.ld inst_rom.o -o inst_rom.om
获取 inst_rom.om 文件
(四)生成 bin 文件
mips-sde-elf-objcopy -O binary inst_rom.om inst_rom.bin
全部评论 (0)
还没有任何评论哟~
