j
Jump
Jumps unconditionally to label, which must lie in the same 256 MB region as the instruction after the jump.
Used in
- Branch on compareMIPS assembly
- LoopsMIPS assembly
- Arrays and stringsMIPS assembly
- Floating point and Coprocessor 1MIPS assembly
- The bitmap display and keyboard registersMIPS assembly
- Maximum and unsigned distanceMIPS assembly
- Sum of an arrayMIPS assembly
- Byte length of a stringMIPS assembly
- Reverse a string in placeMIPS assembly
- A subroutine with its arguments in registersMIPS assembly
Forms
j
Operands
label- A named address in the program, such as the start of a loop or a variable in
.data.
The destination is encoded as a 26-bit word address; the upper 4 bits of PC are combined with this value, so the target must be in the same 256 MB region as the instruction following the jump.
# j transfers to a local target. Inspect $t2: it is 2 at the target.
li $t2, 0
j target
li $t2, 1
target: li $t2, 2