Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions