EasyManua.ls Logo

Texas Instruments TMS320C28x - Page 246

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DMOV loc16
6-89
DMOV loc16 Data Move Contents of 16-bit Location
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
DMOV loc16 1010 0101 LLLL LLLL 1 Y N+1
Operands loc16 Addressing mode (see Chapter 5)
Note: For this operation, registeraddressing modes cannot be used. The modes are:
@ARn, @AH, @AL, @PH, @PL, @SP, @T. An illegal instruction trap will be
generated.
Description Copy the contents pointed to by ”loc16” into the next highest address:
[loc16 + 1] = [loc16];
Flags and
Modes
None
Repeat This instruction is repeatable. If the operation is follows a RPT instruction,
then it will be executed N+1 times.
Example ; Calculate using 16-bit multiply:
; int16 X[3];
; int16 C[3];
; Y = (X[0]*C[0] >> 2) + (X[1]*C[1] >> 2) + (X[2]*C[2] >> 2);
; X[2] = X[1];
; X[1] = X[0];
SPM −2 ; Set product shift to >> 2
MOVP T,@X+2 ; T = X[2]
MPYS P,T,@C+2 ; P = T*C[2], ACC = 0
MOVA T,@X+1 ; T = X[1], ACC = X[2]*C[2] >> 2
MPY P,T,@C+1 ; P = T*C[1]
MOVA T,@X+0 ; T = X[0], ACC = ACC + X[1]*C[1] >> 2
MPY P,T,@C+0 ; P = T*C[0]
ADDL ACC,P << PM ; ACC = ACC + X[0]*C[0] >> 2
DMOV @X+1 ; X[2] = X[1]
DMOV @X+0 ; X[1] = X[0]
MOVL @Y,ACC ; Store result into Y

Table of Contents

Related product manuals