Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Detect hazard in MIPS- repost

  1. Nov 27, 2008 #1
    hi please I would some help with the MIPS hazard.

    Code (Text):


          add $t0, $t0, $v0
          [B]addi $v0, $v0, -1
          bnez $v0, Loop[/B]

          li $v0, 4
          [U]la $a0, result[/U]

          li $v0, 1
          move $a0, $t0

          b main

    I see an hazard at the instructions that are bolded
    What I would do is take the underlined instructions and put it like this:
    Code (Text):
    addi $v0, $v0, -1
    la $a0, result      
    bnez $v0, Loop
    Do I get it right? do I miss another hazard?

    thank you
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted