next up previous
Next: Data Movement Instructions Up: Description of the Machine Previous: Comparison Instructions

Branch and Jump Instructions

In all instructions below, Src2 can either be a register or an immediate value (integer). Branch instructions use a signed 16-bit offset field; hence they can jump tex2html_wrap_inline1741 instructions (not bytes) forward or tex2html_wrap_inline1743 instructions backwards. The jump instruction contains a 26 bit address field.

b labelinstruction tex2html_wrap_inline1671
Unconditionally branch to the instruction at the label.

bczt labelCoprocessor z True
bczf labelCoprocessor z False
Conditionally branch to the instruction at the label if coprocessor z's condition flag is true (false).

beq Rsrc1, Src2, labelon Equal
Conditionally branch to the instruction at the label if the contents of register Rsrc1 equals Src2.

beqz Rsource, labelon Equal Zero tex2html_wrap_inline1671
Conditionally branch to the instruction at the label if the contents of Rsource equals 0.

bge Rsrc1, Src2, labelon Greater Than Equal tex2html_wrap_inline1671
bgeu Rsrc1, Src2, labelon GTE Unsigned tex2html_wrap_inline1671
Conditionally branch to the instruction at the label if the contents of register Rsrc1 are greater than or equal to Src2.

bgez Rsource, labelon Greater Than Equal Zero
Conditionally branch to the instruction at the label if the contents of Rsource are greater than or equal to 0.

bgezal Rsource, labelon Greater Than Equal Zero And Link
Conditionally branch to the instruction at the label if the contents of Rsource are greater than or equal to 0. Save the address of the next instruction in register 31.

bgt Rsrc1, Src2, labelon Greater Than tex2html_wrap_inline1671
bgtu Rsrc1, Src2, labelon Greater Than Unsigned tex2html_wrap_inline1671
Conditionally branch to the instruction at the label if the contents of register Rsrc1 are greater than Src2.

bgtz Rsource, labelon Greater Than Zero
Conditionally branch to the instruction at the label if the contents of Rsource are greater than 0.

ble Rsrc1, Src2, labelon Less Than Equal tex2html_wrap_inline1671
bleu Rsrc1, Src2, labelon LTE Unsigned tex2html_wrap_inline1671
Conditionally branch to the instruction at the label if the contents of register Rsrc1 are less than or equal to Src2.

blez Rsource, labelon Less Than Equal Zero
Conditionally branch to the instruction at the label if the contents of Rsource are less than or equal to 0.

bgezal Rsource, labelon Greater Than Equal Zero And Link
bltzal Rsource, labelon Less Than And Link
Conditionally branch to the instruction at the label if the contents of Rsource are greater or equal to 0 or less than 0, respectively. Save the address of the next instruction in register 31.

blt Rsrc1, Src2, labelon Less Than tex2html_wrap_inline1671
bltu Rsrc1, Src2, labelon Less Than Unsigned tex2html_wrap_inline1671
Conditionally branch to the instruction at the label if the contents of register Rsrc1 are less than Src2.

bltz Rsource, labelon Less Than Zero
Conditionally branch to the instruction at the label if the contents of Rsource are less than 0.

bne Rsrc1, Src2, labelon Not Equal
Conditionally branch to the instruction at the label if the contents of register Rsrc1 are not equal to Src2.

bnez Rsource, labelon Not Equal Zero tex2html_wrap_inline1671
Conditionally branch to the instruction at the label if the contents of Rsource are not equal to 0.

j label
Unconditionally jump to the instruction at the label.

jal labeland Link
jalr Rsourceand Link Register
Unconditionally jump to the instruction at the label or whose address is in register Rsource. Save the address of the next instruction in register 31.

jr RsourceRegister
Unconditionally jump to the instruction whose address is in register Rsource.


next up previous
Next: Data Movement Instructions Up: Description of the Machine Previous: Comparison Instructions

Mitch Roth
Fri Sep 6 23:25:26 ADT 1996