IUP Computer Science
COSC 300        Fall 2005

Exercise #2

Write an assembly language program that prompts for two integer values (call them first and second), reads them in, and calculates their sum and stores it in a location named mid.  The program should then compare mid to 50; if it is greater than or equal to 50, subtract the value in the variable hold from it; if mid is less than 50, add 8 to it.  The program should then display the final result (mid), with some annotating text.  Note:  hold should be initialized 23.

Recommendation:

   Start by writing (or at least sketching) the program in C++.  Then, convert that program to assembly language.  Ask for help as needed
 
 



Part 2 - If There is Time

Given a list of ten integers that are to be used to initialize an array, write  an assembly language program to sum the array elements.  The sum should be displayed (on a separate line) after each integer is added to the total.  There should also be an annotated statement specifying the final sum at the end.

The ten integers are:  3, 6, 12, 8, 2, 1, 4, 1, 10, 5
 

Recommendation:

    Start by writing (or at least sketching) the program in C++.  Then, convert that program to assembly language.  Ask for help as needed