jr
Jump register
Transfers execution to the address stored in $t1.
Used in
- jal, jr, and the course calling conventionMIPS assembly
- Floating point and Coprocessor 1MIPS assembly
- A subroutine with its arguments in registersMIPS assembly
- Stack arguments and a stack frameMIPS assembly
- Recursion: factorial and FibonacciMIPS assembly
- A jump tableMIPS assembly
- Print a number in any base without helpMIPS assembly
- Drawing shapes on the screenMIPS assembly
- A bouncing ballMIPS assembly
- Move a square with the keyboardMIPS assembly
Forms
jr
Operands
$t1- Any general-purpose register,
$0to$31, using its numeric or named spelling, such as$8or$t0($zerois$0;$rais$31).
Most commonly used as 'jr $ra' to return from a function call made with 'jal' or 'jalr'.
# Return through an explicitly initialized register. Inspect $t2: it is 2 at the target.
la $t0, target
jr $t0
li $t2, 1
target: li $t2, 2