![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mips
He_RZ
分享在buaa的学习
展开
-
mips递归实现阶乘
li $v0,5syscallmove $a0,$v0jal fmove $a0,$v0li $v0,1syscallli $v0,10syscallf: li $t1,1 bgt $a0,$t1,recur li $v0,1 jr $rarecur: addi $sp,$sp,-8 sw $a0,0($sp) sw $ra,4($sp) addi $a0,$a0,-1 jal f lw $a0,0($sp) lw $ra,4($sp) addi $sp,$sp,8原创 2020-10-15 14:33:40 · 855 阅读 · 2 评论 -
mips递归实现斐波那契数列
li $v0,5syscallmove $a0,$v0jal fmove $a0,$v0li $v0,1syscallli $v0,10syscallf: li $t2,2 bgt $a0,$t2,recur li $v0,1 jr $rarecur: addi $sp,$sp,-8 sw $a0,0($sp) sw $ra,4($sp) #after store,find f(n-1) addi $a0,$a0,-1 jal f #after f(n-1) was f原创 2020-10-15 14:21:56 · 1304 阅读 · 0 评论