Question: minbills ( ) Implement the following function in MIPS. int minbills ( int totalvalue ) { int count = 0 ; int currvalue = totalvalue;

minbills() Implement the following function in MIPS.
int minbills(int totalvalue){
int count =0;
int currvalue = totalvalue;
while (currvalue >=10){
count +=1;
currvalue -=10;
}
while (currvalue >=5){
count +=1;
currvalue -=5;
}
while (currvalue >=1){
count +=1;
currvalue -=1;
}
return count;
}
To ensure your code adheres to calling conventions, use only temporary registers and the ones specified
in the scaffolding.
minbills:
# At the start of minbills the argument can be found in $a0.
# Replace the line below with your code
li $v0,0
return:
# Your return value should be in $v0 prior to returning.
jr $ra
3

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 Programming Questions!