Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started