我正在尝试了解$ra,所以我想要的输出是“mainfunction1main”,通过main调用function1,function1返回main,main完成。但由于某种原因,我得到了一个打印“mainfunction1mainfunction1......”的无限循环我做错了什么?
.data
mainstring: .asciiz "main"
string1: .asciiz "function1"
string2: .asciiz "function2"
string3: .asciiz "function3"
.text
main: la $a0,mainstring
li $v0, 4
syscall
jal function1
la $a0, mainstring
syscall
function1: la $a0, string1
syscall
jr $ra