Calling C/C++ Functions From Assembly Programs - 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
When compiled with the
lowing code.
_asmfunc:
AX1 = DM(I4 +
SI = DM(I4 +
AX0 = DM(I4 +
DM(ADDRESS(_global_b)) = AX1;
AY0 = DM(I4 +
DM(ADDRESS(_global_a)) = SI;
DM(ADDRESS(_global_b+1)) = AX0;
RTS (DB);
DM(ADDRESS(_global_p)) = AY0;
AX1 = 12345;
_asmfunc.end:
.global _asmfunc;
.type _asmfunc,STT_FUNC;
For a more complicated function, you might find it useful to fol-
low the general run-time model, and use the run-time stack for
local storage, etc. A simple C program, passed through the com-
piler, will provide a good template to build on. Alternatively, you
may find it just as convenient to use local static storage for
temporaries.

Calling C/C++ Functions from Assembly Programs

You may want to call a C/C++ callable library and other functions from
within an assembly language program. As discussed in
Subroutines from C/C++ Programs" on page
ate a test function to do this in C/C++, and then use the code generated by
the compiler as a reference when creating your assembly language program
and the argument setup. Using volatile global variables may help clarify
the essential code in your test function.
1-172
-save-temps
2);
1);
3);
4);
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
option set, this produces the fol-
"Calling Assembly
1-170, you may want to cre-
for ADSP-219x DSPs

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