|
Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring 2009
|
|
Lecture 06: MIPS Programming
Date: Tuesday, February 3, 2009
- Announcements
- Office hours back to normal this week
- Schedule changes - new exam date
- Lab 1 Recap
- Lab 2 Continues
- ask questions!
- there were mistakes in my solution in the shamt and
immedoffset fields, fixed now
- memory is just a bunch of bits, no matter how those bits got
there or how you use them later
- brief discussion of memory management in itemparser example
- brief discussion about Makefiles
- MIPS Programming
- control structures
- byte-sized memory accesses
- string processing example
- subroutines and programs
- registers and the stack
- a recursive subroutine
Due at the start of class, Friday, February 6.
Recall the class example "shiftyproduct" that includes the following
code snip:
product = 0;
while (y) {
if (y&1) product += x;
y >>= 1;
x <<= 1;
}
Suppose the variables x, y, and product are stored in
registers $s0, $s1, $s2, respectively. Write clear
and concise MIPS assembly code for the C code above.
Turn in a hard copy (handwritten or typeset). We will go over this at
the start of class, so no late submissions are accepted.