0

I have the following code I would like to convert into MIPS assembly can someone explain how I would do that.

int A[40], B[40];    
for (i=2; i < 40; i++) {     
   A[i] = A[i] + B[i-2] / A[i-1];   
 }** 
saher
  • 1
  • A compiler can do that for you; read its output to see what it did. https://godbolt.org/ compiler explorer has MIPS GCC. [Is there a way to use gcc to convert C to MIPS?](https://stackoverflow.com/a/63386888) – Peter Cordes Mar 19 '21 at 19:18
  • If you have a specific question about *this* code, like one part of it that you're having trouble with, [edit] your question to be specific, including your attempt at what you have so far. – Peter Cordes Mar 19 '21 at 19:21

1 Answers1

0

I cannot say has to how you would like to do this but if you are looking for an automatic way to do this you could use a C to MIPS compiler. For example, LLVM has a MIPS backend so you could use clang to compile it to MIPS.

Lambda Banquo
  • 81
  • 1
  • 5