0

Having trouble converting this C code into MIPS

if (integers == 0 && forward != 0)
{     
    for (char *ptr = str; *ptr != ’\0’; ptr++)
{
if (*ptr >= ’A’ && *ptr <= ’Z’)
     continue;  
   printf("%c\n", *ptr);
}
MDRIV3
  • 39
  • 1
  • 6
  • Have you tried compiling it and dumping the assembly file? This is usually the '-s' command line switch. – D.Shawley Sep 23 '16 at 01:21
  • Do you have an existing asm frameword (e.g. `integers: .word 0`) or is `integers` in a register (e.g. `$s0`)? Is the fragment you posted the whole body of a function? Are `integers` and `forward` function arguments, function scoped, global, etc.? The correct/best code will be different in these various cases. Also, without context, it's difficult to select which registers to use that don't collide with the other code you have [or will have]. – Craig Estey Sep 23 '16 at 02:42
  • Voting to close. All you've done is dump some code and stated that you're _"having trouble converting this C code into MIPS"_. Alright. What is the question? You've provided no information about what it is _specifically_ that you're having trouble with. – Michael Sep 23 '16 at 08:57

0 Answers0