Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP

Discussion Groups

Discussion Groups | Analog Devices DSPs | Re: Returning to ASM from C

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

Returning to ASM from C - aova...@hotmail.com - Mar 25 7:47:01 2006



Hi Everybody,
Thanks for the answers to my previous question. 
My question now is about what instruction/command should be used to return to asm from a C
function.  The program in asm works with SPORT0 and SPORT2 interrupts, and the C function is
call using the CALL instruction.

Thanks



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: Returning to ASM from C - djthurin - Mar 25 22:38:16 2006

You really need to read the manual.

The manual that contains all of the answers to your questions is the
"C/C++ Compiler and Library Manual

--- In a...@yahoogroups.com, aova2@... wrote:
>
> Hi Everybody,
> Thanks for the answers to my previous question. 
> My question now is about what instruction/command should be used to
return to asm from a C function.  The program in asm works with SPORT0
and SPORT2 interrupts, and the C function is call using the CALL
instruction.
> 
> Thanks
>



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: Returning to ASM from C - "Dr. Norbert Langermann" - Mar 25 22:38:19 2006

Hi again

a...@hotmail.com schrieb:
> Hi Everybody,
> Thanks for the answers to my previous question. 
> My question now is about what instruction/command should be used to return to asm from a C
function.  The program in asm works with SPORT0 and SPORT2 interrupts, and the C function is
call using the CALL instruction.
First, you should call the C function correctly.
IIRC there's a macro ccall, which sets up the stack frame and uses the
special processor command cjump (on 21161, but that should be the same
on 2126x).
You cannot change the way, C returns from a function. That's done by the
C compiler.

BTW when writing ASM functions to be called from C, use the macros
leaf_entry and leaf_exit. You should find them in VisualDSP's help
(along with above ccall, and some more asm macros like puts and gets for
using the C stack).

Regards
Norbert

-- 
Dr. Norbert Langermann - Softwareentwickler
RADIODATA Kommunikationstechnik GmbH
n...@radiodata.biz
OpenPGP-Key: 0x51431418



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )