Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. #JTWILKI - Just The Way I Like It Cooking Assistant
  2. # Created By: Samuel Buzas
  3. #For CS2028 Sect.002
  4. .data
  5. preface: .asciiz "Place you Steak in the oven, and kick back. I'll take care of the rest! \n\n"
  6. RED: .asciiz "Steaks Not Ready Yet Come Back Soon! \n\n"
  7. YELLOW: .asciiz "Get Ready to Eat!! \n\n"
  8. GREEN: .asciiz "Were Ready to Go!!! \n Get The Steak Out Now, Before it Burns!\n\n"
  9. BROWN: .asciiz "Quick It's Starting to Burn!! \n Take it Out!!! \n\n"
  10. BLACK: .asciiz "So how about Soup? \n\n"
  11.  
  12. .text
  13. # Tell User the program is starting
  14. li $v0, 4
  15. la $a0, preface
  16. syscall
  17. # Pause for 10 seconds while users places steak in oven, handy MARS Feature
  18. li $v0, 32
  19. la $a0, 10000
  20. syscall
  21. #Display message,Start Cooking
  22. jal red
  23.  
  24. addi $t1, $zero, 150000 #Max Cooking Time
  25. addi $t0, $zero, 0 # Counter set to 0
  26. addi $t2, $zero, 120000 # Yellow light qualifier
  27.  
  28. # Start Cooking Loop
  29. loop:
  30. beq $t1, $t0, exit
  31. # otherewise incrment and wait
  32. add $t0, $t0, 1000
  33. li $v0, 32
  34. la $a0, 1000
  35. syscall
  36. beq $t0, $t2, soon
  37. j loop
  38.  
  39. exit:
  40. #Display message, Cooking complete
  41. jal green
  42. #Wait 30 Seconds, then overcooking
  43. li $v0, 32
  44. la $a0, 30000
  45. syscall
  46. #Now overcooked
  47. jal brown
  48. #Wait another 30 seconds
  49. li $v0, 32
  50. la $a0, 30000
  51. syscall
  52. # Now its burned
  53. jal black
  54.  
  55. # Terminate Program
  56. li $v0, 10
  57. syscall
  58.  
  59. soon:
  60. jal yellow
  61. j loop
  62.  
  63. #Progress Update Functions
  64. red:
  65. li $v0, 4
  66. la $a0, RED
  67. syscall
  68. jr $ra
  69.  
  70. yellow:
  71. li $v0, 4
  72. la $a0, YELLOW
  73. syscall
  74. jr $ra
  75.  
  76. green:
  77. li $v0, 4
  78. la $a0, GREEN
  79. syscall
  80. li $v0, 31
  81. li $a0, 71
  82. li $a1, 3000
  83. li $a2, 56
  84. li $a3, 127
  85. syscall
  86. jr $ra
  87.  
  88. brown:
  89. li $v0, 4
  90. la $a0, BROWN
  91. syscall
  92. jr $ra
  93.  
  94. black:
  95. li $v0, 4
  96. la $a0, BLACK
  97. syscall
  98. jr $ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement