我想通過學習MIPS Assembly Language Programming學習MIPS大會。在本書中,我有這樣的代碼(從書的第37頁中提取):初級錯誤在當編譯MIPS彙編源
.data
prompt: .asciiz "\n Please Input a Value: "
bye: .asciiz "\n Bye!"
.globl main
.text
main:
li $v0, 4
la $a0, prompt
syscall
li $v0, 5
syscall
beqz $v0, end
move $a0, $v0
li $v0, 1
syscall
b main
end:
li $v0, 4
la $a0, bye
syscall
li $v0, 10
syscall
我有一個cross-compiled binutils針對mips-elf
,但是當我試圖組裝的代碼,我得到了一些錯誤
[email protected]:~/Desktop$ mips-elf-as test-mips.asm
test-mips.asm: Assembler messages:
test-mips.asm:8: Error: illegal operands 'li'
test-mips.asm:9: Error: illegal operands 'la'
test-mips.asm:12: Error: illegal operands 'li'
test-mips.asm:14: Error: illegal operands 'beqz'
test-mips.asm:15: Error: illegal operands 'move'
test-mips.asm:16: Error: illegal operands 'li'
test-mips.asm:22: Error: illegal operands 'li'
test-mips.asm:23: Error: illegal operands 'la'
test-mips.asm:26: Error: illegal operands 'li'
[email protected]:~/Desktop$
我使用Ubuntu的86哈迪赫倫交叉編譯成MIPS
有什麼不對?
你能在這裏看到我的問題http:// stackoverflow。com/questions/9403667/mips-hex-output/9403758#comment11954218_9403758並提供有關將上面的.s程序集文件轉換爲目標文件的過程的響應?謝謝 – NickHalden 2012-02-26 05:41:48