Advertisement
Guest User

Zad3

a guest
Nov 28th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.54 KB | None | 0 0
  1. .text
  2. main:
  3. la $a0, prompt
  4. jal PrintString
  5. li $v0, 5
  6. syscall
  7. move $s0, $v0
  8. jal Oblicz
  9. jal PrintNewLine
  10. la $a0, result
  11. jal PrintString
  12. li $v0, 1
  13. move $a0, $s3
  14. syscall
  15. jal Exit
  16. .data
  17. prompt: .asciiz "Enter integer : "
  18. result: .asciiz "Integer * 10 : "
  19.  
  20. .text
  21. Oblicz:
  22. sll $s1, $s0, 3
  23. add $s2, $s1, $s0
  24. add $s3, $s2, $s0
  25. jr $ra
  26.  
  27.  
  28. .text
  29. PrintNewLine:
  30. li $v0, 4
  31. la $a0, __PNL_newLine
  32. syscall
  33. jr $ra
  34. .data
  35. __PNL_newLine: .asciiz "\n"
  36.  
  37. .text
  38. PrintString:
  39. addi $v0, $zero, 4
  40. syscall
  41. jr $ra
  42.  
  43. .text
  44. Exit:
  45. li $v0, 10
  46. syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement