Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #JTWILKI - Just The Way I Like It Cooking Assistant
- # Created By: Samuel Buzas
- #For CS2028 Sect.002
- .data
- preface: .asciiz "Place you Steak in the oven, and kick back. I'll take care of the rest! \n\n"
- RED: .asciiz "Steaks Not Ready Yet Come Back Soon! \n\n"
- YELLOW: .asciiz "Get Ready to Eat!! \n\n"
- GREEN: .asciiz "Were Ready to Go!!! \n Get The Steak Out Now, Before it Burns!\n\n"
- BROWN: .asciiz "Quick It's Starting to Burn!! \n Take it Out!!! \n\n"
- BLACK: .asciiz "So how about Soup? \n\n"
- .text
- # Tell User the program is starting
- li $v0, 4
- la $a0, preface
- syscall
- # Pause for 10 seconds while users places steak in oven, handy MARS Feature
- li $v0, 32
- la $a0, 10000
- syscall
- #Display message,Start Cooking
- jal red
- addi $t1, $zero, 150000 #Max Cooking Time
- addi $t0, $zero, 0 # Counter set to 0
- addi $t2, $zero, 120000 # Yellow light qualifier
- # Start Cooking Loop
- loop:
- beq $t1, $t0, exit
- # otherewise incrment and wait
- add $t0, $t0, 1000
- li $v0, 32
- la $a0, 1000
- syscall
- beq $t0, $t2, soon
- j loop
- exit:
- #Display message, Cooking complete
- jal green
- #Wait 30 Seconds, then overcooking
- li $v0, 32
- la $a0, 30000
- syscall
- #Now overcooked
- jal brown
- #Wait another 30 seconds
- li $v0, 32
- la $a0, 30000
- syscall
- # Now its burned
- jal black
- # Terminate Program
- li $v0, 10
- syscall
- soon:
- jal yellow
- j loop
- #Progress Update Functions
- red:
- li $v0, 4
- la $a0, RED
- syscall
- jr $ra
- yellow:
- li $v0, 4
- la $a0, YELLOW
- syscall
- jr $ra
- green:
- li $v0, 4
- la $a0, GREEN
- syscall
- li $v0, 31
- li $a0, 71
- li $a1, 3000
- li $a2, 56
- li $a3, 127
- syscall
- jr $ra
- brown:
- li $v0, 4
- la $a0, BROWN
- syscall
- jr $ra
- black:
- li $v0, 4
- la $a0, BLACK
- syscall
- jr $ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement