Hitachi SH7750 Programming Manual page 221

High-performance risc engine superh (sh) 32-bit risc mcu/mpu series
Hide thumbs Also See for SH7750:
Table of Contents

Advertisement

10.5
BF
Conditional Branch
Format
BF label
Description
This is a conditional branch instruction that references the T bit. The branch is taken if T = 0, and
not taken if T = 1. The branch destination is address (PC + 4 + displacement × 2). The PC source
value is the BF instruction address. As the 8-bit displacement is multiplied by two after sign-
extension, the branch destination can be located in the range from –256 to +254 bytes from the BF
instruction.
Notes
If the branch destination cannot be reached, the branch must be handled by using BF in
combination with a BRA or JMP instruction, for example.
Operation
BF(int d)
/* BF disp */
{
int disp;
if ((d&0x80)==0)
disp=(0x000000FF & d);
else
disp=(0xFFFFFF00 | d);
if (T==0)
PC=PC+4+(disp<<1);
else
PC+=2;
}
Branch if False
Summary of Operation
If T = 0
PC + 4 + disp × 2 → PC
If T = 1, nop
Branch Instruction
Instruction Code
10001011dddddddd 1
Rev. 2.0, 03/99, page 207 of 396
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents