0
所以我的jal操作员看起来并不像做它应该做的事情。它看起来就是节省了4个地址,而不是它想要的。我的测试代码是:为什么我的JAL从PC获得+4以上的应该?
.data
test: .asciiz "test"
test1: .asciiz "test1"
test2: .asciiz "test2"
.text
main:
la $a0, test
li $v0, 4
syscall
li $t9, 5 # messing with line before jal
jal next
li $v0, 10
syscall
# it should never hit this code
la $a0, test1
li $v0, 4
syscall
next:
la $a0, test2
li $v0, 4
syscall
jr $ra
li $a0, 1 # it should never hit this code
li $v0, 1
syscall
输出结果为:“执行:执行因错误而终止”。代码并不重要,它只是假设用jal显示问题,有谁知道如何修复pc或jal? (我已经重新安装了mars和java。)
printscreenofjal
谢谢你,这个工作。直到你提到它,我才知道这是一种选择。我也认为重新安装它会重置默认值。尽管现在工作。 – Joseph