Question

Translate this C code into MIPS

C language to MIPS assembly code pleaseee


int hw_func (int num_hws, int avg_hours) {

int total_hw_time;

total_hw_time = num_hws x avg_hours;

return total_hw_time;

}

int exercise_func (int num_exercises, int avg_hours) {

int total_exercise_time;

total_exercise_time = num_exercises x avg_hours;

return total_exercise_time;

}

int total (int nhws, int hours, int nexercises, int ehours) {

int total;

total = hw_func (nhws, hours) + exercise_func (nexercises, ehours);

return total;

}

void main( ) {

int num_homeworks = 4;

int average_hws_hours = 1;

int num_exercises_per day = 2;

int average_exercise_hours = 2;

int total_time = total(num_homeworks, average_hws_hours,

num_exercises_perday, average_exercises_hours);

printf(“%d\n”, total_time);

}


0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 9 more requests to produce the answer.

1 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Translate this C code into MIPS
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT