Assignment 9, due Apr 1

Part of the homework for 22C:60, Spring 2005
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated, and unless there is what insurance companies call "an act of God" - something outside your control; the only exceptions to this rule will be by advance arrangement.

  1. From chapter 9 of the notes, do problems l, o, and z (0.6 points each).

  2. From chapter 10 of the notes, do problems c and e (0.6 points each).

Machine problem 3, Due April 11

Write and test a set of Hawk subroutines that perform BCD arithmetic. These routines operate on unsigned 32-bit BCD integers (8 digits). The interface specificaton for these routines is:

BCDADD
BCDSUB
These both take operands in R3 and R4 and return their result in R3.

BCDMUL
This takes operands in R3 and R4 and returns their product in R3.

BCDDIV
This takes a dividend in R3 and a divisor in R4 and returns the quotient in R3 and the remainder in R4.

Callers should assume the standard Hawk calling sequence (with linkage through R1, using R2 as a stack pointer, and requiring that the called routine return R8 to R15 unchanged). Your routines may call each other as needed.

Your solution should be packaged as a directory called mp3; this directory should containin 2 files, bcd.a, holding the source for your solution to the above assignment, and bcd.h, the header file for your solution.

You are completely responsible for testing your code. In testing it, you will find that the Hex print routine in the Hawk monitor is useful for BCD output! When your work is submitted, it will be assembled and linked to our test program for grading purposes.

The TA's grading program will not exercise overflow conditions, so for this version of the assignment, you are not responsible for how these conditions are handled.