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):

    Loop:

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

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

          li $v0, 1
          move $a0, $t0
          syscall

          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
    b
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted



Similar Discussions: Detect hazard in MIPS- repost
  1. Help with MIPS (Replies: 0)

  2. MIPS help (Replies: 7)

  3. MIPS Runtime Error? (Replies: 1)

  4. MIPS Input/Output? (Replies: 1)

  5. Programming in mips (Replies: 1)

Loading...