Advertisement
chete

Apuntes MIPS

May 15th, 2014
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .data
  2. .text
  3. .globl main
  4. main:
  5. #$a0$a1$a2...
  6. jal funcion ----> salta , $ra direccion retorno
  7. #$v0,$v1
  8. .
  9. .
  10. .
  11. syscall
  12. funcion:
  13.     apilar $ra
  14.     jal funcion----> se llama a si misma
  15.     despilar $ra
  16.     jr $ra
  17. funcion2:
  18. .
  19. .
  20. .
  21. jr $ra
  22.  
  23.  
  24.  
  25.  
  26. RECURSIVAS
  27.     n!= n+(n-1)!
  28.     Caso Trival----> ifactorial(n)=n+factorial(n-1)
  29.  
  30. 4 llamadas
  31. $v0-->5
  32. li $v0, 1-print
  33.     4-print
  34.     5
  35.     8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement