Guest User

Untitled

a guest
Jul 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. # This Program will take in an array of characters and print them in reverse
  2.  
  3.  
  4. .data
  5. Input: .space 4
  6. Prompt: .asciiz "Please enter a string up to 60 characters: "
  7. #Mem: .asciiz "Memory Location: "
  8. #Char: .asciiz "Letter in memory location: "
  9.  
  10. Divider: .asciiz "-----------------------"
  11.  
  12. endl: .asciiz "\n"
  13.  
  14. .text
  15.  
  16. main:
  17.  
  18. li $v0, 4
  19. la $a0, Prompt
  20. syscall
  21.  
  22. ##### Take Input
  23. li $v0, 8
  24. syscall
  25. move $t0, $a0
  26.  
  27. ##### Let's output a byte
  28. li $v0, 1
  29. la $t0, Input
  30. syscall
  31.  
  32. #### Endl
  33. li $v0, 4
  34. la $a0, endl
  35. syscall
  36.  
  37. li $v0, 4
  38. lb $a0, Input
  39. syscall
  40.  
  41. #### Endl
  42. li $v0, 4
  43. la $a0, endl
  44. syscall
  45.  
  46.  
  47. syscall
  48.  
  49. li $v0, 10
  50. syscall
Add Comment
Please, Sign In to add comment