CS 252: Computer Organization
Assembly Project #5
Toys
due at 11:30pm, Wed 6 May 2020
No Late Days
1 Look, Shiny!
MARS has many, many system calls that we have never used. Some could do very cool things if used properly by creative programmers like you all! Take a look here!
Not only that, but also look into tools in the MARS simulator. Check out the Keyboard Tool and Graphics Tool inside the MARS GUI.
Some helpful files will be posted on Piazza. They are comments on the post that declared that Asm5 was released.
2 Ob jective
In this project, I don’t have any objective for you at all – instead, make some- thing interesting and show it off to us. Your code must:
3
•
•
be at least 200 lines of assembly, not counting blank lines and comment- only lines. (For comparison, I examined Asm Project 3 and 4, and the class average was about 290 lines of assembly per project.)
make use of at least one of the extra MARS system calls from the link above, and/or at least one of the extra Tools that the MARS GUI pro- vides.
Make use of it in some interesting way. If you just use it once and then ignore it for the rest of your program, that’s boring! (However, it doesn’t have to be really fancy – I know that you’re just exploring.)
MIPS Instructions
You are now pretty good at writing MIPS code. And since I won’t be doing any automatic testing, I don’t see any reason to limit your assembly code. So you are now free to use any instruction – including pseudoinstructions!
However, you should still write code with good style…
4 Deliverables
You will turn in two things:
1
• Your source code. The TAs will be doing a sanity-check on your code, and also checking it for style and comments.
• Your explanation. This can take one of two forms:
a) A short report describing what you did, and how your code works. This must be at least 500 words, which typically works out to between 1 and 2 pages. Submit this file as a PDF only.
b) A video, posted to YouTube or another site, showing you using your program and explaining a little bit about it. (See below for details.) If you post a video, then upload a PDF or TXT file, telling us where we can find it.
5 Video
Remember, a video is optional – you may write a written report if you prefer. However, if you choose to present your application as a video, then take note:
• Your video should be at least 90 seconds long, not counting any “filler” material, like end screens or long pauses.
• Your video doesn’t need to be “professional,” but it should be of reasonable quality. Do not simply record your computer screen with your phone! Instead, I recommend that you use screen capture software. I’ve been using OBS Studio of late (https://obsproject.com/). It works very well and it’s free.
If you post to YouTube, you are welcome to make the video public or private, it’s up to you. Another option is an Unlisted video, which anyone can view, but which isn’t searchable.
Leave your video accessible until final grades are posted (at least). You are allowed to leave it up longer, if you wish.
6 Late Work
Late work will not be accepted for this project.
7 Brainstorms
Here’s a short list of ideas I came up with as possible programs. Feel free to come up with one of your own!
NOTE! I haven’t actually implemented these, they are just brainstorms. I suspect that some of them might be much more than 200 lines of assembly. Feel free to do a simplified version if the one I suggested was too much.
2
• Encoder. Read characters from the keyboard, encode them somehow, and print out the result.
Simple version: Do ROT-13 encoding. (But will that be enough code to meet the 200 line limit? I don’t know.)
More complex: Do a substitution cipher. Awesome: Simulate an Enigma machine.
• Sorter. Read in integers from the keyboard. (It’s perfectly OK, for this project, to put an upper limit on how many there are.) Sort them, maybe using Bubble Sort, and print them out.
• Guessing game. Generate a random number, then have the user guess. Tell them if they are too high or too low.
• Animation. Draw a picture on the screen. Can you insert the proper amount of delay (or is there a “sleep” syscall???) to make a picture show up on the screen gradually, and change over time?
• Simulation. Use the graphics tool, and implement Conway’s game of life.
• FastBogoSort – https://xkcd.com/1185/
Read 16 integers from the keyboard. Then implement FastBogoSort (from the comic). Print out the list after every shuffle.
• Pong. Animate a ball going left and right. Give the user a paddle, that they can move with the up and down arrows. I actually did this for a project when I was in college.
3