go to previous page   go to home page   hear noise   go to next page


A conditional branch tests a condition then changes the PC if the condition is true (for example, beq $t1,$t2,label).

Branch Equal to Zero

The extended assembler implements several conditional branch instructions beyond the basic ones. For example:

beqz     s,label          # branch to label if register  s == 0
                          # (pseudoinstruction)

The hardware does not have a machine instruction for this operation. It does, however, have a zero register and the beq instruction (branch equal).


Fill in the blanks so the branch is taken if $s1 is zero.

     $s1,,label          # branch to label if register $s1 == 0