Rotl - 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.77

ROTL

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

Advertisement

Table of Contents
loading

Table of Contents