Question: Translate the following C code into RISC-V Assembly. (no need to implement the prints just use ecall) int a[] = {2,2,5,3,4,8,3}; int b[] = {1,4,2,0,-1,5,4};

Translate the following C code into RISC-V Assembly. (no need to implement the prints just use ecall)

int a[] = {2,2,5,3,4,8,3};

int b[] = {1,4,2,0,-1,5,4};

int z[7];

void multiply(int* a, int* b, int* c, int d)

{

for (int i=0; i < d; i++) {

c[i] = a[i] * b[i];

}

}

int main()

{

int n = 7;

multiply(a,b,z,n);

printf("%s", "res: ");

for (int i = 0; i < z; i++)

{

printf("%d", d[i]);

}

printf(" ");

return 0;

}

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 Databases Questions!