Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Fix this in Assembly mips DONT USE C or C++ Problem #3 (25 points-12.5 Points Ea

ID: 3873939 • Letter: F

Question

Fix this in Assembly mips  

DONT USE C or C++

Problem #3 (25 points-12.5 Points Each) a) Write a function in Assembly called Return _Max that would pass unsigned integer values via a0 and a1. The function wil return the maximum value via vo. f the two values are equal will return either value. ent Return Max Return_Max: Nor ek Ir Sra nop . _Max end Retur b) Write function called Get_Average2 in assembly that would load the next two unsigned consecutive integers (4bytes each) from memory. The address of the first integer is stored in $50. The function will take the average of the two integers and ent Get Average2 Get Average2: Ova Sve SRL St,Sta, I r Sra nop end Get Averoge?

Explanation / Answer

a)

Return_Max:

move $t0,$a0

move $t1,$a1

bge $t0,$t1,FIRST_GREAT

SECOND_GREAT:

move $v0,$t1

b FUNC_END

FIRST_GREAT:

move $v0,$t0

FUNC_END:

jr $ra

nop

.end Return_Max

b)

Get_Average2:

lw $t0,0($s0)

lw $t1,4($s0)

add $t2,$t0,$t1

addi $t3,$t3,$zero

div $t2,$t3

mflo $v0

jr $ra

nop

.end Get_Average2