Areeba S.

asked • 11/23/22

Convert C in to assembly language.

Convery the following C code in to MIPS assembly code

 


int a;       // global variable

int main(void)

{


int Q[15];  // array of integers stored at the base address of 0x43210000


int ECE375[15];  // array of integers stored at the base address of 0xBBBB0000


for(int i = 0; i $\leq$ 15; i= i+1)

        ECE375[i] = Q[i] + 2;


int t;


int c = 3; 


a = dofsum(7, 5, c);

t = a - 4;


return t;

}

 


int dofsum(int q1, int q2, int q3)

{

int total, psum1, psum2;


psum1 = sum(q1 + q2);

psum2 = sum(q3 + 4);


total = psum1 - psum2;

return total;

}

 

int sum(int x, int y)

{

int total;

total = x + y;

return total;

}


1 Expert Answer

By:

Jill P. answered • 03/11/23

Tutor
New to Wyzant

Computer Science Professional

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.