Assignment 9, due Apr 1
Part of
the homework for 22C:60, Spring 2005
|
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.
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:
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.