Thread Closed

detect hazard in MIPS- repost

 
Share Thread
Nov27-08, 09:43 PM   #1
 

detect hazard in MIPS- repost


hi please I would some help with the MIPS hazard.

Code:
Loop:

      add $t0, $t0, $v0
      addi $v0, $v0, -1
      bnez $v0, Loop

      li $v0, 4
      la $a0, result
      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:
addi $v0, $v0, -1
la $a0, result      
bnez $v0, Loop
Do I get it right? do I miss another hazard?

thank you
b
PhysOrg.com science news on PhysOrg.com

>> New language discovery reveals linguistic insights
>> US official: Solar plane to help ground energy use (Update)
>> Four microphones, computer algorithm enough to produce 3-D model of simple, convex room
Thread Closed

Similar discussions for: detect hazard in MIPS- repost
Thread Forum Replies
hazard function Set Theory, Logic, Probability, Statistics 3
MIPS help Programming & Comp Sci 7
pros and cons of MIPS relative to instruction set choices Electrical Engineering 1
help with MIPS Programming & Comp Sci 0
small MIPS programmes Introductory Physics Homework 2