beautypg.com

47 lsr (logical shift to the right direction), Lsr (logical shift to the right direction) – FUJITSU FR family 32-bit microcontroller instruction manuel CM71-00101-5E User Manual

Page 165

background image

141

CHAPTER 7 DETAILED EXECUTION INSTRUCTIONS

7.47

LSR (Logical Shift to the Right Direction)

Makes a logical right shift of the word data in "Ri" by "Rj" bits, stores the result to "Ri".
Only the lower 5 bits of "Rj", which designates the size of the shift, are valid and the
shift range is 0 to 31 bits.

LSR (Logical Shift to the Right Direction)

Assembler format:

LSR Rj, Ri

Operation:

Ri >> Rj

Ri

Flag change:

N: Set when the MSB of the operation result is "1", cleared when the MSB is "0".

Z: Set when the operation result is "0", cleared otherwise.

V: Unchanged

C: Holds the bit value shifted last. Cleared when the shift amount is "0".

Execution cycles:

1 cycle

Instruction format:

Example:

LSR R2, R3

N

Z

V

C

C

C

C

MSB

LSB

1

0

1

1

0

0

1

0

Rj

Ri

R2

R3

R2

R3

0 0 F F F F F F

0 0 0 0

0 0 0 8

F F F F F F F F

0 0 0 0

0 0 0 8

N Z V C

CCR

CCR

N Z V C

0 0 0 1

0 0 0 0

Before execution

After execution

Instruction bit pattern : 1011 0010 0010 0011