Computer Science 220
Assembly Language & Computer Architecture

Fall 2011, Siena College

Lecture 0x06: MIPS Programming
Date: Tuesday, September 27, 2011

Agenda

Lecture Assignment 0x06

Due at the start of class, Thursday, September 29.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to jteresco AT siena.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CS 220 Lecture Assignment 0x06, Joe Student). We will discuss these questions at the start of class, so no late submissions are accepted. Recall the 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. (10 points)