| |||
| Home > ARM and Thumb Instructions > Branch and control instructions > TBB and TBH | |||
Table Branch Byte and Table Branch Halfword.
TBB [Rn,Rm]
TBH [Rn,Rm, LSL #1]
where:
Rnis the base register. This contains the address
of the table of branch lengths. must
not be SP.Rn
If PC is specified for ,
the value used is the address of the instruction plus 4.Rn
Rmis the index register. This contains an index into the table.
must not
be PC or SP.Rm
These instructions cause a PC-relative forward branch using
a table of single byte offsets (TBB) or halfword offsets
(TBH). provides
a pointer to the table, and Rn supplies
an index into the table. The branch length is twice the value of
the byte (RmTBB) or the halfword (TBH) returned
from the table. The target of the branch table must be in the same
execution state.
In Thumb-2EE, if the value in the base register is zero, execution branches to the NullCheck handler at HandlerBase - 4.