MIPS NOW ONLINE AVAILABLE ON NEWCUNIX

The TA's have arranged with ACIS to make SPIM, the MIPS assembly
language level simulator, available online, so that you don't have to
install it yourself.  (But you can if you want to.  See info linked to
the HW solutions page.)

You are not required to run programs on SPIM, but I strongly suggest
that you do so.  It isn't really very hard, and you will enjoy seeing
your programs actually work.  It is a very good way to get a real feel
for what assembly language programming is like and to develop a
valuable skill.

You can access SPIM by telnetting to newcunix and typing in spim.
Type help to get a brief summary of key SPIM features and commands.
When using the read or load command remember that double quotes are
needed around the file name.  The portion of the program specification
having to do with data, such as arrays of numbers, or character
strings, must be preceded by .data.  The program itself must be
preceded by .text.  Read about data directives in the text (p. A-14)
and about SPIM (Section A.9), and don't miss reading about syscall,
which you will definitely need to understand (p. A-48).  The sample
program shown here should help you understand what a program has to
look like.  Run it to check it out.  Try out some of the programs we
wrote in class, or which you wrote for HW.

        .data
str1:   .asciiz "\nenter integer i\n"
str2:   .ascii "i = "
        .text
main:   li $v0, 4      #system call code for print_str1
        la $a0, str1   #address of string to print
        syscall        #print str1
        li $v0, 5      #code for read int
        syscall        #read int into $v0
        addi $t0, $v0, 0 #copy i into $t0
        sll $t0, $t0, 3 #mpy $t0 by 8
        li $v0, 4      #system call code for print_str2
        la $a0, str2    #address of string to print
        syscall        #execute syscall to print str2
        li $v0, 1      #code for print int
        addi $a0, $t0, 0 #copy i into $a0
        syscall         #print i