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. Im using pep to code convert this code from C to assembly, please help.
Take the following program and translate it into PEP assembly language:
#include
using namespace std;
int theArray;
void sumPosint ary int len, int &sum
sum ;
for int i ; i len; i
if aryi
sum sum aryi;
int main
int total;
sumPostheArray total;
for int k; k ; k
cout theArrayk endl;
cout "Positive sum is total endl;
return ;
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 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
