One of the things to note about our programming assignment is that the grading will be based upon running your code in spim on the ix server, which is the University of Oregon’s CIS department’s internal server.
To ensure your assignment does not give the grader a nasty surprise and affect your grade, it would be wise to test your code remotely.
OS X 10.5 – 10.7
- Open Terminal (Click Spotlight icon on top-right hand corner of screen, type “Terminal”)
- Find your .s or .asm file, by using commands to go around your home directory. Learn UNIX in 10 minutes is a good resource if you want details.
- Once you find your file, you can upload it by typing
scp myfile.s username@ix.cs.uoregon.edu:myfile.s
and hitting enter. What the
scp
command does is to securely copy your file to the destination based on your ssh login.
username
will be the first part of your @cs.uoregon.edu email address.
- Enter your password when prompted.
- You should see something similar to
myfile.s 100% 8 0.0KB/s 00:00
when your file is done uploading to the server.
- SSH into the ix server by typing
ssh username@ix.cs.uoregon
and entering your password when prompted.
- You should end up in your home directory, and you can list your files by typing
ls
Check that your file is in there.
- To run the your file against spim, type
spim -f myfile.s
and it should assemble and run like you did it from MARS or XSPIM.
Windows
One can use graphical clients like WinSCP to upload your file over SFTP (SSH over FTP), then a SSH client like PuTTY to securely telnet into the ix server to run the commands in the OS X instructions from steps 7 to 8.
Alternatively, you can choose to install OpenSSH for Windows and follow all of the OS X instructions exactly, or perhaps even install the Cygwin package which provides some Linux command-line functionality under windows.
Important testing notes
When testing your code, you must be aware of the edge cases defined in the programming problem. For example, think of the following:
- What happens when you enter more than 50 grades?
- What happens when you enter grades such as 0?
- What happens when you don’t enter any grades? .e.g., entering -1 as the first value.
- Use the sample input given in the assignment PDF: enter the input values exactly, do you get the same output?
- Extra note to the above point, is your mathematical understanding of median the same as the one required in the assignment?
- If spim complains about an error that looks like this:
The following symbols are undefined: main Instruction references undefined symbol at 0x00400014 [0x00400014] 0x0c000000 jal 0x00000000 [main] ; 180: jal main
Don’t panic! spim requires a
main:
immediately after the
.text
declaration to mark the start of the actual program; MARS does not have that requirement. Just add the main label to the start of your program and try again!
Hope all these information would be helpful.