Translate the following code into MIPS assembly language usi


Translate the following code into MIPS assembly language using the sit instruction Assume that the integer variables g and h are in registers $s0 and $s1. if (g > h) B = g + h; else g = g-h;

Solution

slt $t1,$s1,$s0 Else # checks if $s0 > $s1
beq $s0, $s1 # if $s0 > $s1, goes to label
add $s0 $s0 $s1 j Exit
else sub $s0 $s0 $s1
Exit:

 Translate the following code into MIPS assembly language using the sit instruction Assume that the integer variables g and h are in registers $s0 and $s1. if (

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site