-
C to Mips conversion
How can I convert this C code into Mips? Please explain in detail. Thanks
Code:
int sumOfSquares (int start, int count) { int i; int sum = 0; for (i = start; i < count; i++) { sum = sum + i * i; } return sum; } int main (int argc, char **argv) { int start = 5; int count = 5; int sum; sum = sumOfSquares(start, count); }
-
Perhaps you should work on making a readable post.
Did you bother to read your post before posting it?
Does all your code on one line look adequate to you?
Most sane people use a C compiler targeting the MIPS processor for doing what you want to do.
-
This smells an awful lot like homework. Perhaps you didn't read the forum guidelines or homework policy. Remember the point of school (and this board, to a large degree) is to learn, which you wont do if you just get handed solutions.
We can't go around handing out solutions to homework, but we can definitely help you out. Try this on your own, get as far as you can, and then tell us specifically what you are stuck on, then we can help you.
Also, if you want people to look at your problem and help you out, you should try to make their job as easy as possible. That means post your C code with proper line breaks and indentation.
-
And also if you find by googling a way to produce the C code in machine language,do not get confused.This is not going to be MIPS