this should be a function called count. Please answer this in MIPS assembly lang
ID: 2290842 • Letter: T
Question
this should be a function called count. Please answer this in MIPS assembly language.
no pseudos such li, la, mov, etc
Thank you!
void count (&array;, count): The starting address of an array (in Sa0) and the number of integers stored in the array (in Sal) are passed to the function. The function determines how many of the integers in the array are greater than or equal to the average. First the parameters for the average function are set and then average function is called to determine the average value. The returned value is then printed. Then each value in the array is tested to determine if its value is greater than or equal to the average. The count of the values greater than or equal to the average is then printed. 4.Explanation / Answer
Print out string (useful for prompts) .data string1 .asciiz "Print this. " # declaration for string variable, # .asciiz directive makes string null terminated .text main: li $v0, 4 # load appropriate system call code into register $v0; # code for printing string is 4 la $a0, string1 # load address of string to be printed into $a0 syscall # call operating system to perform print operation
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.