Question: 5. (40 pts) You are to write a function MinVal in Mic-1 assembly language that returns in the AC the smaller of two numbers passed
5. (40 pts) You are to write a function MinVal in Mic-1 assembly language that returns in the AC the smaller of two numbers passed by value on the stack. So if, for example, the two numbers are 6 and 7, then 6 and 7 will be on the stack and 6 should be returned in the AC. (That's just an example. Zero points for hardcoding 6 and 7. Your code needs to get the two values off the stack, compare them, and return the smallest.) Show only the function, not the calling code. You must provide reasonable comments to aid in grading. Assume that the call to your function is made such that the following values are on the stack: SP return address of the caller SP+1 Number 1 SP+2 Number2 Min Val: Write the Min Val function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
