2.2.7 Bcc
Bcc (Branch conditionally)
Conditional Branch
Operation
If condition is true, then
PC + disp
→
PC
else next;
Assembly-Language Format
Bcc
disp
→
Condition field
Operand Size
—
Condition Code
H: Previous value remains unchanged.
N: Previous value remains unchanged.
Z:
Previous value remains unchanged.
V: Previous value remains unchanged.
C: Previous value remains unchanged.
I
UI
H
U
N
Z
V
C
—
—
—
—
—
—
—
—
Description
If the condition specified in the condition field (cc) is true, a displacement is added to the program
counter (PC) and execution branches to the resulting address. The PC value used in the address
calculation is the starting address of the instruction immediately following the Bcc instruction.
The displacement is a signed 8-bit or 16-bit value. The branch destination address can be located
in the range from –126 to +128 bytes or –32766 to +32768 bytes from the Bcc instruction.
Note:
*
If the immediately preceding instruction is a CMP instruction, X is the destination operand
and Y is the source operand.
Mnemonic
Meaning
cc
Condition
Signed/Unsigned
*
BRA (BT)
Always (true)
0000
True
BRn (BF)
Never (false)
0001
False
BHI
HIgh
0010
C
∨
Z = 0
X
>
Y (unsigned)
BLS
Low or Same
0011
C
∨
Z = 1
X
≤
Y (unsigned)
BCC (BHS)
Carry Clear (High or Same)
0100
C = 0
X
≥
Y (unsigned)
BCS (BLO)
Carry Set (LOw)
0101
C = 1
X
<
Y (unsigned)
BNE
Not Equal
0110
Z = 0
X
≠
Y (unsigned or signed)
BEQ
EQual
0111
Z = 1
X
>
Y (unsigned or signed)
BVC
oVerflow Clear
1000
V = 0
BVS
oVerflow Set
1001
V = 1
BPL
PLus
1010
N = 0
BMI
Minus
1011
N = 1
BGE
Greater or Equal
1100
N
⊕
V = 0
X
≥
Y (signed)
BLT
Less Than
1101
N
⊕
V = 1
X
<
Y (signed)
BGT
Greater Than
1110
Z
∨
(N
⊕
V) = 0
X
>
Y (signed)
BLE
Less or Equal
1111
Z
∨
(N
⊕
V) = 1
X
≤
Y (signed)
52