Homeworks #1 and #2

Homework #1 -- due 8 February, 1994

Do the following problems from Chapter 8 (pp. 291-293) of the textbook.

Homework #2 -- due 10 February, 1994

Take the following C routine:

#define HASHSIZ 1024
int findit(int T[], int key)
   int h ;

   h = (key*45 + 83) % HASHSIZ ;
   while (T[h] != key || T[h] != 0)
      h = (h+1) % HASHSIZ ;
   return (T[h] == key) ;
  } ;

and compile it on either the DECstations or the Alphas using three different levels of code optimization to generate three different assembly langauge programs corresponding to this C routine. (If you don't know how to do this read the man page. If you don't know how to read the man page to get this information, it's time you learned how.)

Now take your three different assembly language programs and mark them up to show the optimizations performed by the C compiler.

The C routine routine is stored in /usr/local/csci/320/optme.c on the Unix workstations. By the way, the public Alphas are named busbee, tryon, and tuxedo. You'll have to use rlogin to connect to them.

Back to the Handout index