![](http://datasheet.mmic.net.cn/370000/TR4101_datasheet_16743144/TR4101_59.png)
32-Bit Jump and Branch Instructions
4-17
The R-type instruction format, which takes a 32-bit byte address
contained in a register, is used for returns, dispatches, and cross-page
jumps.
Branches have 16-bit signed offsets relative to the program counter
(I-type). Jump-and-link and branch-and-link instructions save a return
address in register number 31 (
ra
).
Table 4.13 summarizes the 32-bit jump and branch instructions.
Table 4.13
32-Bit Jump and Branch Instruction Descriptions
Instruction
Format and Description
Jump
J target
Shifts the 26-bit
target
address left two bits, combines this value with the four
high-order bits of the address of the delay slot, and jumps to the address after a one-
instruction delay.
Jump and
Link
JAL target
Shifts the 26-bit
target
address left two bits, combines this value with the four high-
order bits of the address of the delay slot, and jumps to the address after a one-
instruction delay. Stores the address of the instruction following the delay slot into
register
ra
(the Link register). The Processor mode bit is left unchanged. The value
stored in register
ra
bit 0 reflects the current Processor mode bit.
Jump and
Link
Exchange
JALX target
Shifts the 26-bit target address left two bits, combines this value with the four high-
order bits of the address of the delay slot, toggles the Processor mode bit, and then
jumps to the address after a one-instruction delay. Stores the address of the
instruction following the delay slot into register
ra
(the Link register). The value stored
in register
ra
bit 0 reflects the Processor mode bit before the JALX instruction was
executed.
Jump
Register
JR rs
Jumps to the address contained in register
rs
after a one-instruction delay. The
instruction sets the Processor mode bit to the value in register
rs
bit 0.
Jump and
Link Register
JALR rd, rs
Jumps to the address contained in register
rs
after a one-instruction delay. Stores the
address of the instruction following the delay slot into register
rd
. The value stored in
register
rd
bit 0 reflects the Processor mode bit before the JALR instruction was
executed.
Branch on
Equal
BEQ rs, rt, offset
Branches to the target address
1
if the contents of register
rs
are equal to the contents
of register
rt
.
(Sheet 1 of 2)