detect hazard in MIPS- repost


by brad sue
Tags: detect, hazard, mips, repost
brad sue
brad sue is offline
#1
Nov27-08, 09:43 PM
P: 284
hi please I would some help with the MIPS hazard.

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

thank you
b
Phys.Org News Partner Science news on Phys.org
Going nuts? Turkey looks to pistachios to heat new eco-city
Space-tested fluid flow concept advances infectious disease diagnoses
SpaceX launches supplies to space station (Update)

Register to reply

Related Discussions
hazard function Set Theory, Logic, Probability, Statistics 3
MIPS help Programming & Computer Science 7
pros and cons of MIPS relative to instruction set choices Electrical Engineering 1
help with MIPS Programming & Computer Science 0
small MIPS programmes Introductory Physics Homework 2