Question

Question 4) (12 Marks) This question is based on t
Question 4) (12 Marks) This question is based on t
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution (a) Memory Content of the Code after execution [0x10010000] [0x10010010] [0x10010020] [0x10010030] [0x10010040] [0x1//Loop Loop: register t3-register t0 - 2 register t4 = register t0-1; register-t 1 = theAr ray [register-t3]; register t2 - t
Executable Code

//Headers.
#include <stdio.h>

//Array.
int theArray[40];

//Main().
int main()
{

    //Registers.
    int register_t0;
    int register_t1;
    int register_t2;
    int register_t3;
    int register_t4;
    int register_t5;
    int register_t6;
    int register_t7;

    //Initialization.
    register_t6 = 1;
    register_t7 = 1;

    //Save the first 2 terms of the sequence in theArray
    theArray[0] = register_t6;
    theArray[register_t7] = register_t6;
    register_t0 = 2;
   
    //Loop.
    Loop:
    register_t3 = register_t0 - 2;
    register_t4 = register_t0 - 1;
    register_t1 = theArray[register_t3];
    register_t2 = theArray[register_t4];
    register_t5 = register_t1 + register_t2;
    theArray[register_t0] = register_t5;
    register_t0 = register_t0 + 1;
    if (register_t0 < 40) goto Loop;
    return 0;
}

Add a comment
Know the answer?
Add Answer to:
Question 4) (12 Marks) This question is based on the MIPS assembly code shown below. data...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT