【发布时间】:2018-02-03 05:30:47
【问题描述】:
首先我知道我问了很多问题,但自从我上次问以来我已经走了很长一段路。
我正在使用火星模拟器进行一些辅助项目学习。 我一直对汇编很感兴趣,mips 是我的选择。
无论如何,在我尝试移动我的值并将它们相加后,我的程序似乎崩溃了,我不知道为什么。 感谢您的关注,提示会很棒。 祝你有美好的一天
.data
msg0: .asciiz "enter a number: \n"
msg1: .asciiz "enter another number: \n"
result: .asciiz "result is: \n"
.text
li $v0, 4
la $a0, msg0 #load first message
syscall
li $v0 5
move $t0, $v0 #user input
syscall #store number
li $v0, 4
la $a0, msg1 #second msg
syscall
li $v0, 5
move $t1, $v0 #second input and store number
syscall
li $v0, 4
la $a0, result #rsult message
syscall
add $t3,$t1,$t0 #and my problem is here for some reason?
syscall
【问题讨论】:
-
另外,最后一个
syscall没有意义。添加两个寄存器不是系统调用。
标签: mips mars-simulator