Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->LSR

LSR    Logical Shift Right

Destination shifted by <count> -> Destination


0 -> OPERAND -> C
            -> X


Assembler Syntax:LSR Dx,Dy
LSR #<data>,Dy
LSR <ea>

<ea> - memory alterable only

Dx contains shift count
Immediate shift data may be 1 - 8
Memory can be shifted only 1 bit

Size:  Byte, Word, Long except if Memory Shift when only Word Allowed


Condition Codes:

N    Set if result negative, else cleared
Z    Set if result zero, else cleared
V    Set if the most significant bit is changed at any time during shift operation, else clear
C    Set according to last bit shifted out of operand, cleared for a shift count of zero
X    Set according to last bit shifted out of operand, unaffected by a shift count of zero

    
Allowable Addressing Modes
    
LSRDx,Dy
LSR#(data),Dy
LSR(An)
LSR(An)+
LSR-(An)
LSR(d16,An)
LSR(d8,An,Xn)
LSR(bd,An,Xn)
LSR([bd,An,Xn],od)
LSR([bd,An],Xn,od)
LSR(xxx).W
LSR(xxx).L

Addressing modes with [] are not supported by CPU32 based microcontrollers