IF > GO - Conditional Jump Greater (Signed)¶
Overview¶
Mnemonic: if>go
Function: Conditional jump greater (signed)
Class: BRANCH
Privilege: user
Format: IF > GO <<displacement>>
Description¶
Transfers control if S=0 and Z=0, indicating a positive non-zero result from signed comparison. Used after COMP operations to branch when first operand is greater than second operand in signed comparison.
Operation:
if S=0 and Z=0 then PC += displacement
Key Characteristics:
- Tests for positive non-zero (S=0 and Z=0)
- Signed comparison semantics
- Two variants: byte and halfword displacement
- Common after COMP for greater-than tests
- Sign-extended displacement
Common Use Cases:
- Signed integer comparisons (a > b)
- Maximum value selection
- Descending loop control
- Threshold testing
- Range validation
Operands: 1 (signed displacement) Variants: 2 opcodes
Variants¶
| Variant | Opcode | Displacement |
|---|---|---|
| 1/2 | 0x00C8 | Byte |
| 2/2 | 0x00C9 | Halfword |
Operands¶
Operand 1 (Displacement)¶
Signed displacement.
Trap Conditions¶
- Branch trap (BT): If enabled
Data Status Bits¶
Unaffected.
Examples¶
Example 1: Basic usage¶
W COMP B.A, B.B
IF > GO GREATER
Example 2: Loop control¶
LOOP:
% loop body
IF > GO:B LOOP
Performance Notes¶
- Cycles: 2-3 (not taken), 3-4 (taken)
Reference Manual¶
Section: §13.3 Title: Conditional Jump