Rev. 1.50, 10/04, page 210 of 448
10.1.5
BF (Branch if False): Branch Instruction
Format
Operation
Instruction Code
Cycle
T Bit
BF label
If T = 0
PC + 4 + disp
×
2
→
PC
If T = 1, nop
10001011dddddddd
1 —
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;
}
Example:
CLRT
;
Normally T = 0
BT TRGET_T
;
T = 0, so branch is not taken.
BF TRGET_F
;
T = 0, so branch to TRGET_F.
NOP
;
NOP
;
TRGET_F:
;
←
BF instruction branch destination
Содержание SuperH SH-4A
Страница 2: ...Rev 1 50 10 04 page ii of xx ...
Страница 8: ...Rev 1 50 10 04 page viii of xx ...
Страница 116: ...Rev 1 50 10 04 page 96 of 448 ...
Страница 178: ...Rev 1 50 10 04 page 158 of 448 ...
Страница 206: ...Rev 1 50 10 04 page 186 of 448 ...
Страница 231: ...Rev 1 50 10 04 page 211 of 448 Possible Exceptions Slot illegal instruction exception ...
Страница 235: ...Rev 1 50 10 04 page 215 of 448 Possible Exceptions Slot illegal instruction exception ...
Страница 238: ...Rev 1 50 10 04 page 218 of 448 Possible Exceptions Slot illegal instruction exception ...
Страница 408: ...Rev 1 50 10 04 page 388 of 448 Possible Exceptions Inexact Not generated when FPSCR PR 1 ...
Страница 445: ...Rev 1 50 10 04 page 425 of 448 Possible Exceptions Invalid operation Overflow Underflow Inexact ...
Страница 446: ...Rev 1 50 10 04 page 426 of 448 ...
Страница 468: ...Rev 1 50 10 04 page 448 of 448 ...
Страница 471: ......
Страница 472: ...SH 4A Software Manual ...