PDA

View Full Version : From C to MIPS



Jean_Marc
September 27th, 2015, 02:48 PM
g = 10;
h = 15;
f = g + (h-5);
printf("%d", f);
d=2*f;
printf("%d", d);
f = f-d;
printf("%d", f);

I need to convert this c program into mips assembly code, using only $t0, $t1, $a0, $v0 registers.
I don't know how to do it.

howefield
September 27th, 2015, 02:54 PM
Hello and welcome,

Thread moved to the "Programming Talk" forum.

Jean_Marc
September 27th, 2015, 02:58 PM
Thank you and sorry if the place of the thread is wrong. i'm not used to this forum.

sisco311
September 27th, 2015, 03:40 PM
HI,

Sounds like a homework assignment. Don't expect that someone else will do it for you, but we can help you with some hints.

Where did you get stuck?