Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions