Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the equivalent MIPS assembly code for the C-code shown int A, B, C, D, F declare grade counters int i int N ll declare
Write the equivalent MIPS assembly code for the C-code shown int A, B, C, D, F declare grade counters int i int N 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 (i 0 N; i++) if(scores 90) else if scores80) B=B+1; else if(scores 70) C=C+1 else if scores60) D D+1 else F=F+1; 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 Ss0. 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