![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_109.png)
CHAPTER 2 V
R
4120A
Preliminary User’s Manual S14767EJ1V0UM00
109
(3) Jump and branch instructions
Jump and Branch instructions change the control flow of a program.
All Jump instructions occur with a one-instruction delay. That is, the instruction immediately following the jump is
always executed.
Branch instructions do not have a delay slot. If a branch is taken, the instruction immediately following the branch
is never executed. If the branch is not taken, the instruction immediately following the branch is always executed.
Table 2-40 shows the MIPS16 Jump and Branch instructions.
Table 2-40. Jump and Branch Instructions (1/2)
Instruction
Format and Description
Jump and Link
JAL target
The 26-bit target address is shifted left two bits and combined with the high-order four bits of the
address of the delay slot. The program unconditionally jumps to this calculated address with a delay of
one instruction. The address of the instruction immediately following the delay slot is placed in register
ra. The ISA Mode bit is left unchanged. The value stored in ra bit 0 will reflect the current ISA Mode
bit.
Jump and Link
Exchange
JALX target
The 26-bit target address is shifted left two bits and combined with the high-order four bits of the
address of the delay slot. The program unconditionally jumps to this calculated address with a delay of
one instruction. The address of the instruction immediately following the delay slot is placed in register
ra. The ISA Mode bit is inverted with a delay of one instruction. The value stored in ra bit 0 will reflect
the ISA Mode bit before execution of the Jump execution.
JR rx
The program unconditionally jumps to the address specified in general register rx, with a delay of one
instruction. The instruction sets the ISA Mode bit to the value in rx bit 0. If the Jump target address is
in the MIPS16 instruction length mode, no address exception occurs when bit 0 of the source register
is 1 because bit 0 of the target address is 0 so that the instruction is located at the halfword boundary.
If the 32-bit length instruction mode is changed, an address exception occurs when the jump target
address is fetched if the two low-order bits of the target address are not 0.
Jump Register
JR ra
The program unconditionally jumps to the address specified in register ra, with a delay of one
instruction. The instruction sets the ISA Mode bit to the value in ra bit 0. If the Jump target address is
in the MIPS16 instruction length mode, no address exception occurs when bit 0 of the source register
is 1 because bit 0 of the target address is 0 so that the instruction is located at the halfword boundary.
If the 32-bit length instruction mode is changed, an address exception occurs when the jump target
address is fetched if the two low-order bits of the target address are not 0.