Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!