ASR AX,#1...16
SYNTAX OPTIONS
ASR AX,#1...16
Operands
AX
1016
Description
Flags and
N
Modes
Z
C
Repeat
Example
; Calculate signed value: VarC = (VarA + VarB) >> 2
MOV
AL,@VarA
ADD
AL,@VarB
ASR
AL,#2
MOV
@VarC,AL
1111 1111 101A SHFT
Accumulator high (AH) or accumulator low (AL) register
Shift value
Perform an arithmetic right shift on the content of the specified AX register (AH
or AL) by the amount given in the "shift value" field. During the shift, the value
is sign extended and the last bit to be shifted out of the AX register is stored in
the carry status flag bit:
SIGN
After the shift, if bit 15 of AX is 1 then the negative flag bit is set; otherwise it is
cleared.
After the shift, if AX is 0, then the Z bit is set; otherwise it is cleared.
The last bit to be shifted out of AH or AL is stored in C.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
OPCODE
AX
Right shift
(Immediate value)
AX
; Load AL with contents of VarA
; Add to AL contents of VarB
; Scale result by 2
; Store result in VarC
ASR AX,#1...16
Arithmetic Shift Right
OBJMODE
RPT
CYC
X
−
1
Last bit out
C
Discard
other bits
6-53
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?