Branch if Greater Than : Branch to statement at label if $t1 is greater than $t2
bgt
Operands
$reg, [$reg / imm], idVariants
- Branch if Greater Than : Branch to statement at label if $t1 is greater than $t2 bgt $t1,$t2,label
- Branch if Greater Than : Branch to statement at label if $t1 is greater than 16-bit immediate bgt $t1,-100,label
- Branch if Greater Than : Branch to statement at label if $t1 is greater than 32-bit immediate bgt $t1,100000,label
# Run bgt with one true and one false condition. A taken branch skips the assignment of 1; inspect $t2=2 for taken and $t3=1 for fall-through.
li $t0, 9
li $t1, 2
li $t2, 0
bgt $t0, $t1, taken_one
li $t2, 1
b first_done # Skip the other marker unconditionally.
taken_one: li $t2, 2
first_done:
li $t0, 2
li $t1, 9
li $t3, 0
bgt $t0, $t1, taken_two
li $t3, 1
b second_done # Skip the other marker unconditionally.
taken_two: li $t3, 2
second_done: