Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Convert the high level language conditional instructions to MIPS assembly: if (i == j) f = g + h; else f = g - h;

Convert the high level language conditional instructions to MIPS assembly:

if (i == j)

f = g + h;

else

f = g - h;

Let:

$s3 contain the value of i

$s4 contain the value of j

$s1 contain the value of g

$s2 contain the value of h

A. bne $s3, $s4, Exit

add $s0, $s1, $s2

j Exit

Else: sub $s0, $s1, $s2

Exit:

B. bne $s3, $s4, Else

add $s0, $s3, $s4

j Exit

Else: sub $s0, $s3, $s4

Exit:

C. bne $s3, $s4, Else

add $s0, $s1, $s2

Else: sub $s0, $s1, $s2

D. bne $s3, $s4, Else

add $s0, $s1, $s2

j Exit

Else: sub $s0, $s1, $s2

Exit:

image text in transcribed

Convert the high level language conditional instructions to MIPS assembly: f=g+h; else =g-h; Let: . $s3 contain the value of i $$4 contain the value of j . $s1 contain the value of g . $s2 contain the value of h bne $s3, $s4, Exit add $s0, $s1, $s2 j Exit Else: sub $s0, $s1, $s2 Exit: bne $s3, $s4, Else add $s0, $s3, $S4 j Exit Else: sub $s0, $s3, $s4 Exit bne $s3, $s4, Else add $s0, $s1, $s2 Else: sub $s0, $s1, $s2 bne $s3, $s4, Else add $s0, $s1, $s2 j Exit Else: sub $s0, $s1, $s2 Exit

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

More Books

Students also viewed these Databases questions

Question

List the barriers in data collection for HR analytics.

Answered: 1 week ago