ASR Instruction
Performs an arithmetic 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: |
ASR Dx,Dy |
ASR #<data>,Dy |
ASR <ea> |
EXAMPLE CODE:
ASR.B
#1,D0 if D0.B contained 00011110, it would now be 00001111