Tom Kelliher, CS 220
Due Oct. 19, 2005
Write a MIPS program to recursively enumerate all the straight-line walks of a particular distance a robot may take. The robot takes steps of length one or length two.
You are to ``compile'' from the C source available on the class Web site. All four functions are to be implemented individually and each must use the frame stack. As before, documentation and neatness matter. You will be penalized substantially if your MIPS source is not adequately commented (for instance, letting me know how you have assigned variables from the C source to MIPS registers) and if your MIPS source is not properly formatted (labels in one set of columns, assembler directives and assembly instructions in another set of columns, and comments properly aligned).
In class, turn in hard copy of your MIPS source code, diagrams of your four frame templates, and a sample run of the program. E-mail attachments are not acceptable. Remember, you can use the Linux script command to capture your sample run. The basic idea is:
bluebird:~/Class/Cs220/Examples % script Script started, file is typescript bluebird:~/Class/Cs220/Examples * spim SPIM Version 7.1 of January 2, 2005 Copyright 1990-2004 by James R. Larus (larus@cs.wisc.edu). All Rights Reserved. See the file README for a full copyright notice. Loaded: /usr/local/bin/exceptions.s (spim) load "addn.spim" (spim) run How many inputs? 3 Next input: 5 Next input: 2 Next input: 8 The sum is 15 (spim) quit bluebird:~/Class/Cs220/Examples * exit Script done, file is typescript bluebird:~/Class/Cs220/Examples % lpr -P hs123ps typescript bluebird:~/Class/Cs220/Examples % rm typescriptThe typescript file that was printed with via the lpr command chronicles the terminal session from the time that the script command was executed until the script session was exited via the exit command.