Home / Essays / MIPs coding

MIPs coding

MIPs coding
1.Convert the following C code into assembly using MIPS architecture:
int x, y, z, q;

if ( x == 0 )
{
x = y – q;
}
else
{
x = z + 4;
}
Assume that x, y, z, q are stored on $s0, $s1, $s2 and $s3 respectively.

2.Convert the following C code into assembly using MIPS architecture:
int Q[ 4 ];

for (i=1; i < 4; i++)
{
Q[ i ] = Q[i-1] + 1;
}

Assume that the value of the base address of array Q is stored in register $a0; and that the initial value of “i” is stored in $t0.

FOR YOUR ASSIGNMENTS TO BE DONE AT A CHEAPER PRICE PLACE THIS ORDER OR A SIMILAR ORDER WITH US NOW :)

Leave a Reply

WPMessenger