IUP Computer Science
COSC 300

Project #2
(Due 18 March 2008)


You are to write a program in assembly language that behaves like a very simple calculator.
 

The program should prompt for the operation to be performed and read in one character (+ to add, - to subtract, * to multiply, and / to divide). If instead of these characters a . (period) is entered, the program should halt. If any other character is entered, it should be ignored and control should be returned to the prompt again.
 

The program should then prompt for and read in two unsigned 32-bit integer values, perform the indicated operation on the two values and produce a result. Note: for subtraction, the program should subtract the second value from the first; and for division, the program should divide the second value into the first.
 

After performing the operation, the program should display the sum, difference, product, or quotient with generic label such as "is the answer. " After this display, the program should loop back to the top and prompt again for an operation.
 

Hand in a printout of the .LST file which the assembler produces when assembling your program. Also, hand in a short example of the program's output in which each operation is done at least once and the program halts normally. You may do a cut and paste from the output window to an editor, such as NotePad; then print out the output. Note: when you print the .LST file, do NOT do so with a word processor(unless you maintain Courier font and fixed spacing); instead, use an editor like NotePad and make sure the lines do NOT wrap - you may want to use 10pt type and print in landscape format.
 

You must name the .ASM file after yourself (use your last name). Then, copy the .ASM file to the handin folder on the P: drive for COSC 300.