Question: The book asks to translate this c++ code to MIPS assembly language and make it run in a 64 bit enviorment. I already made a

 The book asks to translate this c++ code to MIPS assembly

The book asks to translate this c++ code to MIPS assembly language and make it run in a 64 bit enviorment. I already made a 32 bit version but dont know what is needed to make it run in a 64 bit enviorment.

This is what i have so far:

slt $t3, $s5, $zero

bne $t3, $zero , Exit

slt $t3, $s5, $t2

beq $t3, $zero , Exit

add $t1, $s5, $s5

add $t1, $t1, $t1

add $t1, $t1, $t4

lw $t0, 0($t1)

jr $t0

L0: add $s0, $s3, $s4

j Exit

L1: add $s0, $s1, $s2

j Exit

L2: sub $s0, $s3, $s4

j Exit

L3: sub $s0, $s1, $s2

Exit:

Example: Compiling a switch Statement using a Jump Address Table. Consider the code: switch (k) case 0: f = i + j; break ; /* k = 0* case 1: f g + h; break ; /* k = 1*/ case 2: fg - h; break; /* k2*/ case 3: f i - j; break ; /* k3* Assume the six variables are contained in registers $s0 to $s5 and that register $12 contains 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!