A Sample Program
                        ----------------

Here is a sample program for SPIM for your convenience. You may
use it as follows:

* Run spim
* Load the sample program using read or load command
* Run the program by typing 
        run __start
* The program waits for two integers to be entered on the terminal
  enter two integers, each followed by a carriage return
* The program will print the result on terminal

The program simply reads these numbers using system calls, performs addition
and prints the result using system calls. It is well commented and easy to 
understand.
-------------------------------------------------------------------------

	.data
message:
	.asciiz "sum = "
	.text
	.globl main

main:	move $s0, $ra		# Save return address 

	li $v0, 5			# system call for read_int
	syscall
	move $t0, $v0		# number read is put in $t0

	li $v0, 5			# system call for read_int
	syscall
	move $t1, $v0		# number read is put in $t1

	add $t3, $t0, $t1		# add the two numbers

	li $v0, 4			# system call for print_string
	la $a0, message		# message to be printed
	syscall

	li $v0, 1			# system call for print_int
	move $a0, $t3		# number in $t3 is to be printed
	syscall

	move $ra, $s0		# Restore return address 
	jr $31			# Return from main