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, 21.06.2019 21:30
What elements related to the release and success of the nes console do you see in modern console releases? what elements are no longer relevant to modern console gaming?
Answers: 3
question
Computers and Technology, 22.06.2019 13:50
The instruction ishl (shift left integer) exists in jvm but not in ijvm. it uses the top two values on the stack, replacing the two with a single value, the result. the sec- ond-from-top word of the stack is the operand to be shifted. its content is shifted left by a value between 0 and 31, inclusive, depending on the value of the 5 least signifi- cant bits of the top word on the stack (the other 27 bits of the top word are ignored). zeros are shifted in from the right for as many bits as the shift count. the opcode for ishl is 120 (0x78).a. what is the arithmetic operation equivalent to shifting left with a count of 2? b. extend the microcode to include this instruction as a part of ijv.
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
You know the right answer?
Take the following program and translate it into PEP/9 assembly language: #include using namespace s...
Questions
question
Mathematics, 08.12.2021 18:30
question
Mathematics, 08.12.2021 18:30
question
Mathematics, 08.12.2021 18:30
Questions on the website: 13722361