Hitachi SH7750 Programming Manual page 235

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

Advertisement

Operation
BTS(int d)
{
int disp;
unsigned temp;
temp=PC;
if ((d&0x80)==0)
disp=(0x000000FF & d);
else disp=(0xFFFFFF00 | d);
if (T==1)
PC=PC+4+(disp<<1);
else PC+=4;
Delay_Slot(temp+2);
}
Example
SETT
BF/S
TRGET_F
NOP
BT/S
TRGET_T
ADD
R0,R1
NOP
TRGET_T:
/* BTS disp */
;Normally T = 1
;T = 1, so branch is not taken.
;
;T = 1, so branch to TRGET_T.
;Executed before branch.
;
;← BT/S instruction branch destination
Rev. 2.0, 03/99, page 221 of 396

Advertisement

Table of Contents
loading

Table of Contents