Prepare a program in mips assembly language that reads in a


Question- Finding the maximum, the median and the minimum in MIPS

Prepare a program in MIPS assembly language that reads in a sequence of signed 32-bit integers (words) and return the maximum, the minimum, and the median value of the input sequence.

A "special value" 9999 will be used to signify the end of the input sequence. This value is not to be considered part of the input data set.

Thus, any value greater than 9999 that is entered prior to 9999 is considered as a valid input. Zero and negative values are also valid. Empty input sets are also valid.

cases:

Input: 1 3 2 4 5 9999

Output: max: 5; min: 1; median: 3

To avoid division operation, when there are even numbers in the series, you can choose the smaller middle value and median, e.g.,

Input: 1 3 2 4 9999

Output: max: 5; min: 1; median: 2

Use the given line to set up memory to hold the input:

.data

vals: .space 4000

I am having difficulty with this question because I do not know where to start with.

Request for Solution File

Ask an Expert for Answer!!
Assembly Language: Prepare a program in mips assembly language that reads in a
Reference No:- TGS0966291

Expected delivery within 24 Hours