LSR Instruction
Performs a logical shift to the right on a data register or a memory location. There are three possibilities:
1. Shift a data register to the right. Number of steps is stored in another
data register.
2. Shift a data register to the right. Number of steps is an immediate value.
Shift range 1-8 bits.
3. Shift a word in the memory one bit to the right.
ADDRESS METHODS: 3) (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l
DATA LENGTH: Byte, word, longword
FLAGS: |
X - The last bit that was sent out of the operand. Unaffected if number of steps is 0. |
N - S |
Z - S |
C - Same as X |
V - Set if the most significant bit was changed during the operation, otherwise it is cleared.
|
SYNTAX: |
LSR Dx,Dy |
LSR #<data>,Dy |
LSR <ea> |
EXAMPLE CODE:
LSR.B #1,D0 if
D0.B contained 00011110, it would now be 00001111