subject

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 = 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.
Also the extra to make theArray a local array in main.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
What can tanya do now to start preparing for the college and scholarship application process? think about her grades, activities in which she can get involved, possible part-time jobs at which she can work, and standardized tests she can take. (10 points) apex
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Jamie has to enter the names, employee id’s, and income of a group of employees into a worksheet. which option will jamie use to describe the data
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
You know the right answer?
Take the following program and translate it into PEP/9 assembly language: #include using namespace s...
Questions
question
Biology, 01.12.2020 14:00
question
Mathematics, 01.12.2020 14:00
question
Mathematics, 01.12.2020 14:00
Questions on the website: 13722367