brad sue
November 27th, 2008, 09:09 PM
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
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