Asm() Construct Template Example - Analog Devices VISUALDSP++ 3.5 Manual

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

The compiler cannot check whether the operands have data types
that are reasonable for the instruction being executed. The com-
piler does not parse the assembler instruction template, does not
interpret the template, and does not verify whether the template
contains valid input for the assembler.

ASM() Construct Template Example

The following example shows how to apply the
to the ADSP-219x assembly language
{
int x, result;
asm ("%0=abs %1;" :
"=c" (result) :
"c" (x));
}
In the previous example, note the following points:
• The template is "
zero
(result)
one
(x)
• The output operand is the C/C++ variable
the operand constraint for the variable. This constrains the output
to an
ALU
output from the register to the variable result, if necessary. The "
in
indicates that the operand is an output.
=c
• The input operand is the C/C++ variable
and constraint for the variable. This constrains
If
is stored in different kinds of registers or in memory, the com-
x
piler generates code to copy the values into an register before the
construct uses them.
asm()
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
%0=abs %1;
, the first operand. The
.
result register. The compiler generates code to copy the
asm()
instruction:
abs
". The
is replaced with operand
%0
is replaced with operand
%1
result
. The letter
x
Compiler
construct template
. The letter
is
c
="
is the oper-
c
to an
register.
x
ALU
1-67

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents