ROTL

Rotation to left

ROTL

ROTate Left


[Syntax]

ROTL src, dest

 

[Operation]

unsigned long tmp0, tmp1;

tmp0 = src & 31;

tmp1 = dest << tmp0;

dest = (( unsigned long ) dest >> ( 32 - tmp0 )) | tmp1;

[Function]

-

This instruction rotates dest leftward by the number of bit positions specified by src and saves the value in dest. Bits overflowing from the MSB are transferred to the LSB and to the C flag.

-

src is an unsigned integer in the range of 0 ? src ? 31.

-

When src is in register, only five bits in the LSB are valid.

 

[Instruction Format]

Syntax

Processng Size

src

dest

Code size

(Byte)

ROTL src, dest

L

#IMM:5

Rd

3

L

Rs

Rd

3

[Flag Change]

Flag

C

Z

S

O

Change

 

 

 

Conditions

C: After the operation, this flag will have the same LSB value as dest. In addition, when src is 0, this flag will have the same LSB value as dest.

Z: The flag is set if dest is 0 after the operation; otherwise it is cleared.

S: The flag is set if the MSB of dest after the operation is 1; otherwise it is cleared.

[Description Example]

ROTL #1, R1

ROTL R1, R2]