Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1 The C-code shown below will loop through an aray of marks (integer values between 0 and 100) and calculate a histogram of these
Problem 1 The C-code shown below will loop through an aray of marks (integer values between 0 and 100) and calculate a histogram of these marks int A, B, C, D, F int i int N declare grade counters ll declare loop counter l Number of scores to analyse A-O: B-0; C-0: D=0; F=0; // initialize grade counters l Read in test scores into grades array? If N will be equal to the number of grades // assume N = 50 for (i0 N; i++) if(scores 90) else if(scores[i] >= 80) B=B+1; else if(scores[i] 70) C=C+1 else if(scores!--60) D D+1 else F=F+1; Write the equivalent MIPS assembly code for the C-code shown above. You should assume the following: - The number of scores, N, to be analysed is 50 The address of the first element in the marks array is contained in SSO. Additionally, to make it easier for you to keep track of register assignments, you may use register names that have the same name as the variable names used in the code above. For example, to initialize the register that holds the A counter, you might write: add SA, S0, S0 If you do choose to use actual MIPS register names, you should write your code out as follows (i.e. with appropriate comments): add Sto. $0. S0 # St0 maps to variable A: we need to initialize it to 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started