
330845509ee_32| Application Note
Engineer To Engineer Note
EE-32
Notes on using Analog Devices' DSP, audio, & video components from the Computer Products Division Phone: (800) ANALOG-D or (781) 461-3881, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com
Language Extensions: Memory Storage Types, ASM & Inline Constructs
Last Modified: 05/11/96
Support for asm() inlining of assembly language The following demo code will help illustrate the use of these extensions and provide further information on them.
This EE Note has been conceived as guidelines for users programming our 21xx-DSPs in C. It consists of several pieces of examples as opposed to a whole project. These examples have been conceived general-purposed to allow the users to run them without any piece of hardware, just using the Simulator. The aim of these guidelines is namely to illustrate some fundamentals with appropriate examples, making thus the theory better understandable.
Language extensions
The G21 C compiler supports a set of extensions to the ANSI standard for the C programming language. These extensions are specific to the ADSP processors and comprise: Support for separate program and data memory (keywords pm, dm) Support for inline functions
LANG_EXT.C
/* lang_ext.c */ /* program demonstrating the use of the G21 extensions */ /* to the C language */
1
#include "pointdef.h" int aux; static static static static int int int int dm dm pm dm x ; y ; z ; i[3]={10,20,30};
/* contains predefined pointers */
/* placing variables in specific */ /* memory spaces */
5
DINT pointer;
/* DINT is defined in pointdef.h */ /* for a pointer to a dm integer */ /* define add() as inline */
static inline int add(void)
330845509ee_32 Application Note analog Download PDF
Add this permalink to your bookmarks for future download of 330845509ee_32 ApplicationNote
Permalink: http://application.emcelettronica.com/analog/330845509ee_32