當我等待減法的結果出現時,會出現這個問題,但是它會顯示出0.不是x-a,因爲我希望它會。Mips中的摘要
.data
strin: .asciiz "type two integers\n\n\n"
strout: .asciiz "the result of the substract is:"
a: .word 0
x: .word 1
.text
main:
li $v0, 4
la $a0,strin
syscall
li $v0, 5
syscall
sw $t0,a
li $v1,5
syscall
sw $t1,x
sub $t1,$t1,$t0
li $v0, 4
la $a0,strout
syscall
move $a0, $t1
li $v0, 1
syscall
li $v0,10
syscall
您可能要考慮*爲什麼*您將輸入存儲到內存中。 (提示:'syscall'可能會破壞寄存器) – EOF
請不要破壞你的帖子。 – Glorfindel
請不要破壞你自己的問題。這對那些努力回答你的問題的人們是不敬的! –