Rev. 1.50, 10/04, page 213 of 448
Operation:
BFS(int d) /* BFS disp */
{
int disp;
unsigned int temp;
temp = PC;
if ((d&0x80)==0)
disp = (0x000000FF & d);
else disp = (0xFFFFFF00 | d);
if (T==0)
PC = PC + 4 + (disp<<1);
else PC += 4;
Delay_Slot(temp+2);
}
Example:
CLRT ;Normally T = 0
BT/S TRGET_T ;T = 0, so branch is not taken.
NOP ;
BF/S TRGET_F ;T = 0, so branch to TRGET.
ADD R0,R1 ;Executed before branch.
NOP ;
TRGET_F: ;← BF/S instruction branch destination
Possible Exceptions:
• Slot illegal instruction exception