# MIPS Basics
# CSC 211
# Outline with problem labels and macro written by Jerod Weinman

# Ensure the following labels are externally visible
.globl problem1, problem2, problem3, problem4

.text                              # Start generating instructions

# From "Macros in MARS", 
# <https://courses.missouristate.edu/KenVollmar/MARS/Help/MacrosHelp.html>
.macro done  # Define a macro [frequently used instruction sequence] named done
li $v0, 10   # Set the syscall argument to 10, which terminates execution
syscall      # Issue the system call (based on the value in $v0)
.end_macro   # End macro definition

# main is not a special name in MARS, but we label it anyway for familiarity
main:
  # You can jump to whatever place you feel like for your own testing. HOWEVER:
  # The autograder will only jump to labels "problemX" where X=1,2,... etc.
  # after having done its own set up, so ONLY code within those "blocks"
  # will be run (not the setup blocks) 

  j problem3_setup # Example jump for a particular problem
        
problem1_setup: 
  # ADD ANY SETUP CODE FOR YOUR OWN TESTING HERE (and delete this comment)
  # NONE OF THIS SECTION WILL BE RETAINED OR USED WHEN GRADING
problem1:
  # ADD YOUR IMPLEMENTATION CODE HERE (and delete this comment)
  done # macro shorthand for terminating execution

problem2_setup: 
  # ADD ANY SETUP CODE FOR YOUR OWN TESTING HERE (and delete this comment)
  # NONE OF THIS SECTION WILL BE RETAINED OR USED WHEN GRADING
problem2:
  # ADD YOUR CODE HERE (and delete this comment)
  done # macro shorthand for terminating execution

problem3_setup: 
  # ADD ANY SETUP CODE FOR YOUR OWN TESTING HERE (and delete this comment)
  # NONE OF THIS SECTION WILL BE RETAINED OR USED WHEN GRADING
problem3:
  # ADD YOUR CODE HERE (and delete this comment)
  done # macro shorthand for terminating execution
  
problem4_setup: 
  # ADD ANY SETUP CODE FOR YOUR OWN TESTING HERE (and delete this comment)  
  # NONE OF THIS SECTION WILL BE RETAINED OR USED WHEN GRADING
problem4:
  # ADD YOUR CODE HERE (and delete this comment)
  done # macro shorthand for terminating execution
