Texas Instruments TMS320C28x Reference Manual page 211

Dsp cpu and instruction set
Table of Contents

Advertisement

ASR AX,T
ASR AX,T
SYNTAX OPTIONS
ASR AX,T
Operands
AX
T
Description
Flags and
N
Modes
Z
C
Repeat
Example
; Calculate signed value: VarC = VarA >> VarB;
MOV
MOV
ASR
MOV
6-54
Accumulator high (AH) or accumulator low (AL) register
Upper 16 bits of the multiplicand (XT) register
Perform an arithmetic shift right on the content of the specified AX register as
specified by the four least significant bits of the T register, T(3:0) = shift
value = 0...15. The contents of higher order bits are ignored. During the shift,
the value is sign extended. If the T(3:0) register bits specify a shift of 0, then C
is cleared; otherwise, C is filled with the last bit to be shifted out of AX:
SIGN
After the shift, if bit 15 of AX is 1 then the negative flag bit is set; otherwise it is
cleared. Even if the T(3:0) register bits specify a shift of 0, the value of AH or
AL is still tested for the negative condition and N is affected.
After the shift, if AX is 0, then the Z bit is set, otherwise it is cleared. Even if the
T(3:0) register bits specify a shift of 0, the value of AH or AL is still tested for the
zero condition and Z is affected.
If T(3:0) specifies a shift of 0, then C is cleared; otherwise, C is filled with the
last bit to be shifted out of AH or AL.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
T,@VarB
AL,@VarA
AL,T
@VarC,AL
OPCODE
1111 1111 0110 010A
AX
Right shift
(Contents of T [3:0])
AX
; Load T with contents of VarB
; Load AL with contents of VarA
; Scale AL by value in T bits 0 to 3
; Store result in VarC
Arithmetic Shift Right
OBJMODE
RPT
X
Last bit out or cleared
C
Discard other bits
CYC
1

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C28x and is the answer not in the manual?

Table of Contents

Save PDF