dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 392

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
ASR16
Operation:
S >> 16 → D
Description: Arithmetically shift the source operand to the right by 16 bits, and store the result in the destination
Usage:
Example 1:
Explanation of Example:
Example 2:
Explanation of Example:
Condition Codes Affected:
A-48
Before Execution
Before Execution
A2
0
(D), sign extending to the left. This operation effectively places the MSP of the source register into the
LSP of the destination register, propagating the sign bit through the MSP (and the extension register
for accumulator destinations). If the source is an accumulator, both the extension register and MSP are
shifted. When the destination operand is a 16-bit register, the sign information is written to it. For ex-
ample, if the source is an accumulator, the 4 bits of the EXT are written to the lower 4 bits of the des-
tination register with sign extension. If the source is a 16-bit register or the Y register, the msb (sign
bit) is written with sign extension. The result is not affected by the state of the saturation bit (SA).
This instruction can be used to cast an integer to a long value.
ASR16
Prior to execution, the Y register contains the value to be shifted ($A1A2:A3A4). The contents of the
destination register are not important prior to execution because they have no effect on the calculated
value. The ASR16 instruction arithmetically shifts the value $A1A2:A3A4 by 16 bits to the right, sign
extends to a full 36 bits, and places the result in the destination register A.
ASR16
Prior to execution, the Y register contains the value to be shifted ($A3A2:A1A0). The contents of the
destination register are not important prior to execution because they have no effect on the calculated
value. Since the destination is a 16-bit register, the ASR16 instruction arithmetically shifts the value
of the sign bit by 16 bits to the right with sign extension, and places the result in the destination register
X0.
The condition codes are not affected by this instruction.
A1A2
A3A2
(no parallel move)
3456
A1
Y1
Y1
Y,A
Y,X0
Arithmetic Shift Right 16 Bits
DSP56800E Core Reference Manual
; shift long in Y right by 16 bits and place in A
A3A4
; shift sign bit in Y right by 16 bits and sign extend
A1A0
3456
0000
A0
Y0
Y0
X0
Assembler Syntax:
ASR16
After Execution
After Execution
A2
F
S,D
FFFF
A1A2
A3A2
A1
Y1
Y1
Freescale Semiconductor
(no parallel move)
A1A2
A3A4
A1A0
FFFF
A0
Y0
Y0
X0
ASR16

Related parts for dsp56800e