Modify the following code to make use of the delayed branch

Modify the following code to make use of the delayed branch slot on a pipelined MIPS processor. loop: lw $2, 100($3) sub $4, $4, $5 beq $3, $4, loop

Solution

There is one way to filling branch delay slot would be:

addiu                     $2, $2, 4

loop:lw                                 $2, 100($3)

addi                       $1, $1, 1

sw                          $1, 200($2)

beq                        $2, $10, LOOP

addiu                     $2, $2, 4                #use the delay slot to increase $2

 Modify the following code to make use of the delayed branch slot on a pipelined MIPS processor. loop: lw $2, 100($3) sub $4, $4, $5 beq $3, $4, loopSolutionThe

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site