.data 0x10000000
.text
main:
addu $s7,$ra,$0
li $v0,5
syscall
addi $a0,$v0,0
j fact
li $v0,1
syscall
addu $ra,$0,$s7
jr $ra
fact:
addi $sp,$sp,-8
sw $ra,4($sp)
sw $a0,0($sp)
slti $t0,$a0,1
beq $t0,$zero,exit1
addi $v1,$0,1 #return 1
addi $sp,$sp,8
jr $ra
exit1:
addi $a0,$a0,-1
jal fact
lw $a0,0($sp)
lw $ra,4($sp)
addi $sp,$sp,8
mul $v1,$v1,$a0
jr $ra
做一个n!递归,请问错在哪里呢,求教