Using Mixed C/C++ And Assembly Naming Conventions - 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

C/C++ and Assembly Language Interface
Using Mixed C/C++ and Assembly Naming
Conventions
It is necessary to be able to use C/C++ symbols (function names or vari-
able names) in assembly routines and use assembly symbols in C routines.
This section describes how to name C/C++ and assembly symbols and
shows how to use C/C++ and assembly symbols.
To name an assembly symbol that corresponds to a C/C++ symbol, add an
underscore prefix to the C/C++ symbol name when declaring the symbol
in assembly. For example, the C/C++ symbol
symbol
.
_main
To use a C/C++ function or variable in your assembly routine, declare it as
global in the C/C++ program and import the symbol into the assembly
routine by declaring the symbol with the
The C++ language performs name mangling on function names it defines
according to the output and input parameter types of the function. If call-
ing into a C++ defined function from assembly code, the
will need to be the mangled C++ output name. This is best retrieved by
looking at the compiler's assembly output for the C++ source that defines
the required function.
To use an assembly function or variable in your C/C++ program, declare
the symbol with the
and import the symbol by declaring the symbol as
program.
Alternatively, the
(used similarly to the "C" linkage specifier of C++), which when used,
removes the need to add an underscore prefix to the symbol that is defined
in assembly.
Table 1-18
shows several examples of the C/C++ and assembly interface
naming conventions.
1-174
assembler directive in the assembly routine
.GLOBAL
compiler provides an "
cc219x
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
becomes the assembly
main
assembler directive.
.EXTERN
.EXTERN
in the C/C++
extern
" linkage specifier
asm
for ADSP-219x DSPs
symbol

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?

Questions and answers

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents