Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- main:
- li $v0,5
- syscall
- move $a0,$v0
- li $v0,5
- syscall
- move $a1,$v0
- jal funzione
- move $a0,$v0
- li $v0,1
- syscall
- li $v0,10
- syscall
- funzione:
- add $t0,$a0,$a1
- bgez $t0,caso_base
- subu $sp,$sp,24
- sw $ra,0($sp)
- sw $a0,4($sp)
- sw $a1,8($sp)
- sub $a0,$a0,2
- add $a1,$a1,3
- jal funzione
- lw $ra,0($sp)
- lw $t1,4($sp)
- lw $t2,8($sp)
- add $sp,$sp,24
- mul $t1,$t1,2
- mul $t2,$t2,3
- sub $t3,$t1,$t2
- add $v0,$v0,$t3
- j fine
- fine:
- jr $ra
- caso_base:
- li $v0,12
- jr $ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement