#################################################################### # # # 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 # subu $sp, $sp, 4 # allocate stack frame sw $ra, 0($sp) # save return address # # Main body # # Register usage: # EXPLAIN USAGE OF ANY REGISTERS WHOSE USE IS DEDICATED TO ONE TASK # IN YOUR CODE HERE... # # main exit # exit: lw $ra, 0($sp) # restore return address addiu $sp, $sp, 4 # pop stack frame j $ra # return