Need help for this and the extra:
Take the following program and translate it into PEP/9 assemblylanguage: #include using namespace std;
int theArray[] = { 5, 11, -29, 45, 9, -1};
void sumPos(int ary[], int len, int &sum)
{
sum = 0;
for (int i = 0; i < len; i++)
if(ary[i] > 0)
sum = sum + ary[i];
}
int main()
{
int total;
sumPos(theArray, 6, total);
for (int k=0; k < 6; k++)
cout << theArray[k] <<endl;
cout << “Positive sum is ” << total <<endl;
return 0;
}
You must use equates to access the stack and the index registerin accessing the array. Remember, the sumPos array does
PayPal Gateway not configured
PayPal Gateway not configured