Question: Complete the following code runMathOper which takes an input ( character: + , - , * , / ) and runs the appropriate routine. (
Complete the following code "runMathOper" which takes an input character: and runs the appropriate routine. Assume that we already defined the functions "AddNumb", "SubNumb", and "MultNumb", etc. Hence, you don't need to worry about those functions.
Unfortunately, we have some bugs in "runMathOper" function procedure Please complete the code.
bash
Copy code
data OperTable: word AddNumb # Each entry in the table consists of the ASCII math operator word SubNumb # followed by the address label of the function to branch to word MulNumb word DivNumb text Main: jal runMathOper # End of Main runMathOper: lb $t$a # Input: Math Operation # Its not necessary to perform any error checking sub $t $t # Adjust ASCII to perform operation la $t OperTable # Returns using bit instruction the appropriate routine # address using $t to get the base address sll $t $t # Shift left by multiply by to get word offsetMissing Instruction Here jr $t
We have a MISSING INSTRUCTION here. Provide your answer in the following space to complete the code.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
