5.4.4 Branching
The branching instructions add an offset to the PC. This allows relocatable code and
code that crosses page boundaries. There are two forms of branching,
BRW
and BRA
. The PC will have incremented to fetch
the next instruction in both cases. When using either branching instruction, a PCL
memory boundary may be crossed.
If using BRW
, load the W register with the desired unsigned
address and execute BRW
. The entire PC will be loaded with the address
PC + 1 + W.
If using BRA
, the entire PC will be loaded with PC + 1 +
the signed value of the operand of the BRA
instruction.