CS 154 Microcode Modification Lab

Due: 23:59 4/14/09.

Work in groups of no more than three people. Make sure each person understands the lab, as your individual knowledge will be tested during interactive grading and during exams. In the event of interactive grading your labs MUST be graded within posted time slots or you will get a zero. All group members must be present so that they can be individually graded.

NOTE: Labs 1-3 depend upon each other. It is very important that you keep up with the due dates and get all three labs working. You will not be able to do the labs until you have successfully completed the previous ones! You will be given 5 late days total for all 5 labs -- save them for labs 2 and 3!

You will need to use a Unix or Linux machine for this assignment (such as those in CSIL -- you can use them remotely if you like).


In this problem you will extend the Mac-1 instruction set, by adding a FIND instruction, which finds the address of the first occurrence of a 16-bit integer in a block of 16-bit integers in memory. We will be using the DePaul University MicMac simulator. You will need to go to the Mic/Mac web page and get a copy of the simulator and related documentation. Install the simulator on a Linux or Unix machine (such as in CSIL). Also have a look at some hints on running the simulator.


Some people have had trouble installing the software for Lab 1. Susmit has put a world-readable version of the mic-mac software on CSIL at:

/cs/class/cs154/ist

There is a binary you can install at home also at:

/cs/class/cs154/ist.tar.gz


The MIC-1 microprogram you will modify is in ist/frend/one/one.mal
With some minor differences, this is essentially the same code as described in the Matloff handout and described in class. You will also need to modify one.def if you change any of the opcodes. You must also write your own test MAC program.

Assume that the FIND instruction requires that its arguments are already on the stack: the integer to find is at m[sp], the starting address of the block of integers is in m[sp+1], and number of words (integers) is in m[sp+2]. When the instruction completes, pop off the arguments and write the result (address of the first occurrence of the search integer) in m[sp].

It is completely up to you how you implement FIND, other than the technical restrictions set here.

Your design must allow the correct execution of any existing MAC-1 machine-language program.


MISC...
  1. Homework submission:
    1.  Your TA will clarify the use the handin program in discussion or on the mailing list.
    2. Only one member of each group should submit the lab 
    3. Submit the following files:
      • one.mal
      • one.mac
      • one.def
      • GROUP
      The file GROUP will list the full name, login, and student ID for each member of the group.
    EXTRA CREDIT will be given for whichever homework team submits the fastest implementation of FIND.

    By the way, this "contest" is in keeping with microcoding in general. In high-level programming, we usually don't care about small increases in speed; usually the clarity of the code is more important. But microcode directly affects the overall speed of the machine itself, so optimal code is of great value.


Last updated April  2009
chong@cs.ucsb.edu