The objective of this programming assignment are 1) learn how to write assembly language routines that can be called from C/C++, 2) gain further insight into two's complement arithmetic.
When you think about it, integer variables in C/C++ are really horrible. If you add two large positive numbers together, you can get an overflow and end up with a negative number. What's worse, the programmer has very little control over the situation. Unlike assembly language programming, no flags are set when an overflow occurs.
In C++, you can make your data types. For this project, you are provided with a predesigned class called BigInt. When you add two BigInts together, you never get an undetected overflow. The data structure is automatically expanded to fit a larger number. However, as we mentioned previously, overflows are hard to detect in C/C++, so part of the implementation of the BigInt class must be done in assembly language programming.
For this project, you will write the assembly language code that will finish the implementation of the BigInt class. The C++ source for the BigInt class can be found in the directory:
The header file bimath.h has the function prototypes of the functions that need to be implemented. The file bimath.asm has the stubs for these functions. Note that for assembly language programs to work with C++, the labels for the entry points of the functions have funny looking names. This is because C++ allows function names to be overloaded. However, C++ functions use the same parameter passing convention as far as the stack is concerned.
These files as they are will compile. For example, you can type in the commands:
For 92% of the project grade, you must implement the addition, subtraction
and comparison functions. If you implement multiplication, you get the
remaining 8%. Division is 10% extra credit.
Before you submit your program, record some sample runs of your program using the UNIX script command. You should select sample runs that demonstrate the features supported by your program. Picking good test cases is your responsibility.
Create a file called README. In the file, describe the features that you have implemented and those you have not. Include instructions on how to compile your project. If certain parameters cause your program to crash, describe those. And of course, describe the cases where your program functions correctly.
Use the UNIX submit command on the GL system to turn in your project. You should submit the README file and all the files needed to compile and run your program. The class name for submit is "cs313&" and the project name is "proj2".
Addendum: make a typescript file of your sample runs and submit that
file as well.