![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 28.08.2020 19:01 tejasheree
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](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
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](/tpl/images/cats/istoriya.png)
History, 06.12.2020 23:50
![question](/tpl/images/cats/User.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 06.12.2020 23:50
![question](/tpl/images/cats/en.png)
English, 06.12.2020 23:50
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 06.12.2020 23:50
![question](/tpl/images/cats/istoriya.png)
History, 06.12.2020 23:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 06.12.2020 23:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 06.12.2020 23:50
![question](/tpl/images/cats/mat.png)
Mathematics, 06.12.2020 23:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 06.12.2020 23:50