C to Mips conversion

This is a discussion on C to Mips conversion within the Tech Board forums, part of the Community Boards category; How can I convert this C code into Mips? Please explain in detail. Thanks Code: int sumOfSquares (int start, int ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    1

    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);  }

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,541
    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.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,496
    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.

  4. #4
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,681
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MIPS synchronisation (ll/sc)
    By stud91 in forum Tech Board
    Replies: 2
    Last Post: 02-12-2012, 08:47 AM
  2. help me convert c to mips
    By chicken in forum C Programming
    Replies: 3
    Last Post: 11-03-2010, 10:35 AM
  3. Converting C to MIPS?
    By Brech in forum C Programming
    Replies: 1
    Last Post: 03-25-2010, 05:51 PM
  4. Need help with Mips
    By NoobieGecko in forum C Programming
    Replies: 11
    Last Post: 02-25-2008, 01:57 PM
  5. Have you ever programmed for MIPS?
    By Maragato in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-05-2004, 08:32 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21