Question: I need to code this in assembly language. I ' m using pep / 9 to code convert this code from C + + to

I need to code this in assembly language. I'm using pep/9 to code convert this code from C++ to assembly, please help.
Take the following program and translate it into PEP/9 assembly language:
#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 register in accessing the array. Remember, the sumPos array does NOT know about the global "theArray" the address of the array must be passed via the parameter.
For 10 points extra credit, make theArray a local array in main.
Submit source code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!