253 assignment: CALC.asm

Come to class as there may be corrections, changes and additions.

Create an assembly program using emu8086

Submit a SINGLE FILE (unzipped) callled "CALC.asm" to D2L

Follow these directions to SUBMIT to D2L

Grading Sheet.

Create an assembly program using emu8086

Submit a SINGLE FILE (unzipped) callled "CALC.asm" to D2L

Follow these directions to SUBMIT to D2L

Grading Sheet.

Using the documentation standards discussed, do the following:
- Clear screen
- Locate the cursor near the middle (middle-ish) of the screen
- Prompt the user for two numbers and apply the following operations:
ADD them and display the answer
AND them and display the answer (logic refresher)
OR them and display the answer
XOR them and display the answer
** If ANY answer is zero, print "ZERO" instead of "0"

Use emu8086.inc library (GOTOXY, CLEAR_SCREEN) to control screen Use emu8086 instructions to perform logical operations (intel ref) Use a user-defined procedure to print "ZERO" (PROC) to ADD (PROC) to AND (PROC) to OR (PROC) to XOR (PROC) Using a loop instruction or equivalent jmp (jz, jnz), repeat until the user says no more repetitions (0 no / 1 yes) Include comments and use well-named variables.

Example (each problem will write in the same spot as the previous after clearing the screen): ------- Enter a number: 10 Enter another: 2 10 + 2 = 12 10 AND 2 = 2 10 OR 2 = 10 10 XOR 2 = 8 More? 1 Enter a number: -1 Enter another: 1 1 + -1 = ZERO 1 AND -1 = 1 1 OR -1 = -1 1 XOR -1 = -2 More? 1 Enter a number: 1 Enter another: 1 1 + 1 = 2 1 AND 1 = 1 1 OR 1 = 1 1 XOR 1 = ZERO More? 0**All problems will write in the same location as the first problem**
emu8086.inc library: GOTOXY, CLEAR_SCREEN

Use emu8086.inc library (GOTOXY, CLEAR_SCREEN) to control screen Use emu8086 instructions to perform logical operations (intel ref) Use a user-defined procedure to print "ZERO" (PROC) to ADD (PROC) to AND (PROC) to OR (PROC) to XOR (PROC) Using a loop instruction or equivalent jmp (jz, jnz), repeat until the user says no more repetitions (0 no / 1 yes) Include comments and use well-named variables.

Example (each problem will write in the same spot as the previous after clearing the screen): ------- Enter a number: 10 Enter another: 2 10 + 2 = 12 10 AND 2 = 2 10 OR 2 = 10 10 XOR 2 = 8 More? 1 Enter a number: -1 Enter another: 1 1 + -1 = ZERO 1 AND -1 = 1 1 OR -1 = -1 1 XOR -1 = -2 More? 1 Enter a number: 1 Enter another: 1 1 + 1 = 2 1 AND 1 = 1 1 OR 1 = 1 1 XOR 1 = ZERO More? 0