Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Assume the following two MIPS codes are given to you. Answer the following questions based on the assumptions that values of 10, 20,

  

4. Assume the following two MIPS codes are given to you. Answer the following questions based on the assumptions that values of 10, 20, 30, and 40 are assigned to registers $30, $s1, $s2, $s3, and $s4 respectively. Assume that the base address of the array B is in registers $s6 and has the value of 256. Code 1: add $30, $s0, $sl add $s0, $s3, $s2 add $50, $s1, $s3 You're also given the following memory allocation with saved values: 0 ... Code 2: addi $36, $s6, -20 add $s6, $s6, $sl lw $50, 8 ($s6) 10 35 12 43 18 256 .. a. For the given MIPS instructions above, what are the corresponding C codes? c. b. For each code given above, find the value saved in register $80 at the end of execution. Comment on the performance of the compiler based on the corresponding MIPS code output. Should you continue to use the same compiler for your other programs? Or should you look for another one? Why? Explain your answer in detail.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

a The corresponding C code for Code 1 would look like int temp ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Financial Management

Authors: James Van Horne, John Wachowicz

13th Revised Edition

978-0273713630, 273713639

More Books

Students also viewed these Programming questions