SHLL

Logical and arithmetic shift to the left

SHLL

SHift Logical and arithmetic Left


[Syntax]

(1)SHLL src, dest

(2)SHLL src, src2, dest

 

[Operation]

(1)dest = dest << ( src & 31 );

(2)dest = src2 << ( src & 31 );

 

[Function]

-

(1)This instruction arithmetically shifts dest to the left by the number of bit positions specified by src and saves the value in dest.

-

Bits overflowing from the MSB are transferred to the C flag.

-

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

-

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

-

(2)After this instruction transfers src2 to dest, it arithmetically shifts dest to the left by the number of bit positions specified by src and saves the value in dest.

-

Bits overflowing from the MSB are transferred to the C flag.

-

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

 

[Instruction Format]

Syntax

Processng Size

src

src2

dest

Code size

(Byte)

(1)SHLL src, dest

L

#IMM:5

Rd

2

L

Rs

Rd

3

(1)SHLL src, src2, dest

L

#IMM:5

Rs

Rd

3

[Flag Change]

Flag

C

Z

S

O

Change

 

 

 

 

Conditions

C : The flag is set if the shifted-out bit is 1; otherwise it is cleared. However, when src is 0, this flag is also cleared.

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.

O : This bit is cleared to 0 when the MSB of the result of the operation is equal to all bit values that have been shifted out (i.e. the shift operation has not changed the sign); otherwise it is set to 1.However, when scr is 0, this flag is also cleared.

[Description Example]

SHLL #3, R2

SHLL R1, R2

SHLL #3, R1, R2