Rotcl - Hitachi SH7750 Programming Manual

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

Advertisement

10.75

ROTCL

One-Bit Left Rotation
through T Bit
Format
ROTCL Rn
Description
This instruction rotates the contents of general register Rn one bit to the left through the T bit, and
stores the result in Rn. The bit rotated out of the operand is transferred to the T bit.
ROTCL
Operation
ROTCL(long n) /* ROTCL Rn */
{
long temp;
if ((R[n]&0x80000000)==0) temp=0;
else temp=1;
R[n]<<=1;
if (T==1) R[n]|=0x00000001;
else R[n]&=0xFFFFFFFE;
if (temp==1) T=1;
else T=0;
PC+=2;
}
Example
ROTCL R0
ROTate with Carry Left
Summary of Operation
T ← Rn ← T
MSB
T
;Before execution R0 = H'80000000, T = 0
;After execution
Instruction Code
0100nnnn00100100 1
R0 = H'00000000, T = 1
Rev. 2.0, 03/99, page 345 of 396
Shift Instruction
Execution
States
LSB
T Bit
MSB

Advertisement

Table of Contents
loading

Table of Contents