Category:MIPS Assembly: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) m (→See Also) |
Puppydrum64 (talk | contribs) m (→BNE) |
||
Line 91: | Line 91: | ||
* Effect: Compares the register operands, and if they're not equal, adds (signed) the specified offset to <code>PC</code>. (usually a labeled line of code that the assembler translates to a calculated offset.) Otherwise, execution falls through to the ''instruction after the instruction after'' the <code>bne</code>. This is not a typo, that's how MIPS works. |
* Effect: Compares the register operands, and if they're not equal, adds (signed) the specified offset to <code>PC</code>. (usually a labeled line of code that the assembler translates to a calculated offset.) Otherwise, execution falls through to the ''instruction after the instruction after'' the <code>bne</code>. This is not a typo, that's how MIPS works. |
||
=== |
===BNEZ=== |
||
* Stands for: '''B'''ranch if '''N'''ot '''E'''qual to '''Z'''ero |
* Stands for: '''B'''ranch if '''N'''ot '''E'''qual to '''Z'''ero |
||
* Usage: <code> |
* Usage: <code>bnez $operand1,label</code> |
||
* Example: <code> |
* Example: <code>bnez $t0,T0_Nonzero</code> |
||
* Effect: |
* Effect: If the register operand doesn't contain zero, adds (signed) the specified offset to <code>PC</code>. (usually a labeled line of code that the assembler translates to a calculated offset.) Otherwise, execution falls through to the ''instruction after the instruction after'' the <code>bnez</code>. This is not a typo, that's how MIPS works. |
||
==See Also== |
==See Also== |