shopnobhumi 0 Light Poster

I am trying to convert some instruction to MIPS code. But have no idea how to do that.. i know c language so i can decode it to C but dont know how to convert it to MIPS.
1.I need to write a main
2. create an array of 10 integers
3.Declare a variable
4.make a loop to check if it is odd or even
5. print a string saying "it is odd or it is even creating if else statement
6.and increment the variable.
I can write C program for these. But what would it be in MIPS?

int main()
{
int array[10]={1,2,3,4,5,6,7,8,9,10};
int i=0;
while(i<10){
if(i%2==0)
printf("It is even\n");
else 
printf("it is odd\n");
i=i+1;
}
return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.