CPE 315
Winter 2008
Laboratory Project #2
Due by 3:10 pm, Tuesday Feb. 5
Lab 2 FAQ
Notes:
- This is an individual assignment.
- All submission and plagarism rules are in effect.
- Don't use any MIPS pseudoinstructions, except la, in this lab.
- You can assume there are no overflows generated by your program.
Objectives:
- To learn how to write MIPS assembly code.
- To appreciate the la pseudo instruction.
Reference:
Appendix A of our text has a complete manual for the MIPS ISA, XSPIM and its
MIPS assembler.
Description:
- Write a MIPS program
Write a program that inputs a set of integers (both positive and negative), terminated by a 0.
The program determines the smallest integer, the total number of integers and
the number of even/odd integers.
The results must be displayed on the XSPIM console window.
Constraints and Hints
- la
You may use the la pseudo-instruction but no other pseudo instructions.
- No priming read
Do all of the inputs with one syscall, inside a single loop.
No priming read permitted.
- Initialize smallest
Initialize the register that holds your smallest value to maxint.
- Test Cases
If you've forgotten how to generate proper test cases, talk to
me during lab time.
Proper test cases are a major part of this lab grade.
- Prove the program works
Be sure you can run the program with this command line:
xspim   -nopseudo -file lab2.asm
Do screen prints of (at least 3 good) test cases that prove your
program works.
If you prefer, you can demo your program during lab on Feb. 5; include
your test cases in the formal lab report.
Deliverables
A formal lab submission as described in the syllabus.
Even if you plan on demoing during lab, include written test
cases in your formal report.
Last updated on 1/27/08