Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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 Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

Let X Uniform(a, b). Find EX.

Answered: 1 week ago

Question

the difference between procedural and substantive fairness

Answered: 1 week ago

Question

Describe the concept of diversity.

Answered: 1 week ago

Question

Summarize forecasting human resource availability.

Answered: 1 week ago