########################## GENERAL INSTRUCTIONS ##########################

- Implement the two MIPS functions described below.  You should modify *only*
  the bodies of the functions as indicated in each file.  Do not change the
  function names or modify other parts of this file.

- Remember your calling conventions!  Arguments are passed to functions in
  $a0-$a3, return values passed back in $v0-$v1.  If your function is going to
  clobber any of the preserved registers, you must save them before
  overwriting, and restore before returning.  When calling another function,
  you cannot count on values in non-preserved registers surviving across a
  function call.  Refer to slides or text for full list of preserved and
  non-preserved registers.

###################### ADMINISTRATIVE INSTRUCTIONS ########################

- Use Spim to develop and test your code.  Spim is available:
      - On cunix.cc.columbia.edu (log in using your UNI)
      - For download, from http://spimsimulator.sourceforge.net/
      - Documentation can be found here:
      	 	http://spimsimulator.sourceforge.net/further.html

- We will grade on CUNIX, so if you use your own computer it would
  be wise to run your code there before turning in.

- To turn in your code, first the included zip-submission script.  This will
  generate a zip file containing your files and named with your UNI.  Upload
  the resulting zip file to Courseworks.  

- IMPORTANT: Be sure to download and open the file you uploaded to confirm
  that the contents are correct.

######################### UPPERCASE (uppercase.s) ##########################

In this problem you will implement a function called 'uppercase' which takes a
string and converts it to uppercase.  
 
Your function takes one argument, a pointer to a string, converts the string
to upper case in place (i.e., overwriting lowercase characters with their
uppercase values), and returns the value 0 to indicate success.	 Valid strings
will contain only alphanumberic characters (i.e., a-zA-Z0-9).  If an input has
an invalid character, you must leave the input string unchanged and return the
integer 1 to indicate an error.
 
The relevant ASCII codes are:

       0-9 = 48-57
       A-Z = 65-90
       a-z = 97-122

For reference, the correct output for a working implementation is:

       $ spim -file uppercase.s 
       << SNIP: SPIM software info >>
       Before: Hello
       Return: 0
       After: HELLO
       Before: 1World
       Return: 0
       After: 1WORLD
       Before: abc?
       Return: 1
       After: abc?

############################ TREE SUM (tree.s) #############################

Implement the tree_sum function, which sums up the values of the nodes in a
binary tree.  Each node is represented by three consecutive words in memory,
representing the value of the node, the address of the left child, and the
address of the right child, respectively.  See the .data section of tree-sum.s
for two examples. Your function should accept a single argument, the address
of the root node in the tree, and return a single integer representing the sum
of all of the nodes in the tree.

For reference, the correct output for a working implementation is:

       $ spim -file uppercase.s 
       << SNIP: SPIM software info >>
       Input:  { 1 { 2 }  { 3 }  } 
       Sum: 6
       Input:  { 31 { 45 { 25 }  { 34 }  }  { 62 { 0 }  }  } 
       Sum: 197



