Question: The following code must be converted to MIPS using a jump address table. Asume the 6 variables are contained in registers $s0 to $s5 and
The following code must be converted to MIPS using a jump address table. Asume the 6 variables are contained in registers $s0 to $s5 and that register $t2 contains 4. Variable K needs to be asked to the user:
--------------------------------------------------------------------------------------------------------------------------------------------------------
CODE: switch (k) {
case 0: f = i + j; break ; /* k = 0*/
case 1: f = g + h; break ; /* k = 1*/
case 2: f = g - h; break ; /* k = 2*/
case 3: f = i - j; break ; /* k = 3*/
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
