LSR

LSR

Bitwise Shift Right One Bit (DALU)

LSR

Operation

Assembler Syntax

(Dn>>>1) → Dn; 0 → Dn[39]

LSR Dn

Description

 

LSR Dn

 

Shifts the contents of a data register (Dn) right one bit. The LSB (bit 0) is shifted into the carry (C) bit in the status register. Bits [39:1] are copied to bits [38:0]. Bit 39 is cleared.

Status and Conditions that Affect Instruction

None.

Status and Conditions Changed by Instruction

Register Address

Bit Name

Description

SR[0]

C

Dn[0] is stored in the C bit.

Ln

L

Clears the Ln bit in the destination register.

Example

lsr d4

Register/Memory Address

SR

L4:D4

Before

$00E4 0000

$0:$FF CCCC CCCD

After

$00E4 0001

$0:$7F E666 6666

Instruction Formats and Opcodes

Instruction

Words

Cycles

Type

LSR Dn

1

1

1

Note: ** indicates serial grouping encoding.

Opcode

158 70

0 * 1 0 0 1 F F F 1 1 0 1 1 1 0

Instruction Fields

Dn

FFF

 

Single Source/Destination Data Register

 

 

 

000

D0

010

D2

100

D4

110

D6

 

 

 

 

 

 

 

 

 

 

001

D1

011

D3

101

D5

111

D7

 

 

 

 

 

 

 

 

Note:

This instruction

can specify D8-D15 as operands by using a prefix.

 

 

A-226

SC140 DSP Core Reference Manual

Page 540
Image 540
Freescale Semiconductor SC140 specifications Bitwise Shift Right One Bit Dalu, Lsr d4, Dn1 → Dn 0 → Dn39, LSR Dn