Reference no: EM132291869
Problem:
Starting with the following C++ program:
#include <iostream>
using namespace std;
extern "C" long Average (long, long []);
void main ()
{
long Array1 [10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
long Array2 [11] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
cout << "Average of Array1 is " << Average (10, Array1) << endl;
cout << "Average of Array2 is " << Average (11, Array2) << endl;
}
How to Write in assembly language (in a separate file named Lab8.asm) the function Average. The first parameter is the number of elements in an array, the second is the address of the array. The function will determine the average of the values in the array and return the average rounded to the nearest whole number (if the fractional part of the result is equal to or greater than .5, the result is rounded to the next higher number.