Hardware Reference
In-Depth Information
When a short-branch instruction is executed, a signed 8-bit offset is added to the value in
the program counter when a specified condition is met. Program execution continues at the
new address. The numeric range of the short-branch offset value is $80 (2128) to $7F (127) from
the address of the instruction immediately following the branch instruction. A summary of the
short-branch instructions is in Table 2.2.
When a long-branch instruction is executed, a signed 16-bit offset is added to the value in
the program counter when a specified condition is met. Program execution continues at the
Unary Branches
Mnemonic
Function
Equation or Operation
bra rel8 or lbra rel16
brn rel8 or lbrn rel16
Branch always
Branch never
1 = 1
1 = 0
Simple Branches
Mnemonic
Function
Equation or Operation
bcc rel8 or lbcc rel16
bcs rel8 or lbcs rel16
beq rel8 or lbeq rel16
bmi rel8 or lbmi rel16
bne rel8 or lbne rel16
bpl rel8 or lbpl rel16
bvc rel8 or lbvc rel16
bvs rel8 or lbvs rel16
Branch if carry clear
Branch if carry set
Branch if equal
Branch if minus
Branch if not equal
Branch if plus
Branch if overflow clear
Branch if overflow set
C = 0
C = 1
Z = 1
N = 1
Z = 0
N = 0
V = 0
V = 1
Unsigned Branches
Mnemonic
Function
Equation or Operation
bhi rel8 or lbhi rel16
bhs rel8 or lbhs rel16
blo rel8 or lblo rel16
bls rel8 or lbls rel16
Branch if higher
Branch if higher or same
Branch if lower
Branch if lower or same
C + Z = 0
C = 0
C = 1
C + Z = 1
Signed Branches
Mnemonic
Function
Equation or Operation
bge rel8 or lbge rel16
bgt rel8 or lbgt rel16
ble rel8 or lble rel16
blt rel8 or lblt rel16
Branch if greater than or equal
Branch if greater than
Branch if less than or equal
Branch if less than
N V = 0
Z + (N V) = 0
Z + (N V) = 1
N V = 1
Note:
1. Each row contains two branch instructions that are separated by the word or.
2. The instruction to the left of or is a short branch with 8-bit offset.
3. The instruction to the right of or is a long branch with 16-bit offset.
Table 2.2 Summary of short and long branch instructions
 
 
Search WWH ::




Custom Search