Question: in Mips use the example below to Modify larger.s to let the user to enter three numbers and output the largest value li $v0,

in Mips use the example below to Modify larger.s to let the user to enter three numbers and output the largest value

"

li $v0, 5 #load syscall read_int into $v0.

syscall #make the syscall.

add $t0,$v0,$zero # move the number, read into $t0.

## Get second number from user, put into $t1.

li $v0, 5 #load syscall read_int into $v0.

syscall # make the syscall.

add $t1,$v0,$zero #move the number,read into $tv1.

##Get third number from the user, put into $t2

li $v0, 5 #load syscall read_into $v0.

syscall # make the syscall.

add $t0,$v0,$zero #third number in $t2 XXX $t0 should be $t2 , third number should be in $t2"

The Example below

  1. Modify sum.s to find the sum of all positive numbers in the array. You need to test the program with some negative numbers in the array.

bge $t1,$t0,L1

move $t1,$t0 #largest number in $st1

L1: //xxx when you gets here $t1 is larger between first two

bge $t2,$t1,L2//xxx

move $t2,$t1

L2://xxxx //when you gets here $t2 is the largest

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!