CPSC2320 Computer Org & Assembly Language

Homework #3

Assigned:  September 30, 2008

Due: midnight October 8, 2008

 

Attached you will find a MIPS assembly language program that could be used to balance your checkbook (Prog3Template). Negative transaction values correspond to checks drawn on the checking account and positive transactions values correspond to deposits into the checking account. The program terminates when a value of zero is read in. After each transaction the new calculated balance is displayed.

 

Run this program. Use the single step feature to observe the contents of the registers as the program executes. Set a few breakpoints in the program and observe the results. Notice that this program only works for integer values.

 

Run this program and input two deposits in the amount of 1234567890.  You will notice that this program does not contain any instructions to detect when overflow occurs so it produces an erroneous balance when overflow does occur. Your job for this programming assignment is to make improvements to this program so that whenever an overflow does occur in either the positive or negative domain the following specific announcement will be displayed:

 “Overflow Occurred – Transaction Ignored

Next the correct previous balance should be displayed on the following line in the Balance column. Then the program should prompt the user for the next transaction.

No message other than the one specified above is acceptable!

 

Be sure to place in-line comments within the program everywhere you have made changes to the initial program. Each of your comments should be preceded by ##FL (where FL are your first and last initials, respectively) to make it easy to find your modifications to the initial program.