#################################################################### # # # NAME: # # # #################################################################### # # Template for SPIM Program # # You should feel free to use this file as a template for creating # your own test programs. # #==================================================================== # Static data allocation and initialization #==================================================================== # PUT YOUR STATIC DATA DEFINITIONS HERE .data #==================================================================== # Program text #==================================================================== .text .globl main main: # # Main program entry # sw $ra, 0($sp) # save return address subu $sp, $sp, 4 # allocate stack # # Main body # # Register usage: # EXPLAIN USAGE OF ANY REGISTERS WHOSE USE IS DEDICATED TO ONE TASK # IN YOUR CODE HERE... # # main exit # exit: addiu $sp, $sp, 4 # pop stack lw $ra, 0($sp) # restore return address jr $ra # return