Technical discussions about the TI C3x DSPs (including the C31, C32 and C33 DSPs).
Post a new Thread
NEED HELP IN C PROGRAMMING C3X - zingapower - May 5 1:58:00 2005
salam
i am new user of tms320c3x i need to write a c program for adaptive
noise cancellation , i have to ask u people where to start off ,anyone
of who have written c programs for this dsp ,where did they learn the
basics actually i am confused in mixed assembly and c thanx

(You need to be a member of c3x -- send a blank email to c3x-subscribe@yahoogroups.com )
Re: NEED HELP IN C PROGRAMMING C3X - Keith Larson - May 5 9:03:00 2005
Hello Zingapower!
If you look in the C3x Compiler users guide you will find a listing of
registers that need to be preserved during a function call. The next
thing you will want to do is play with some simple inline assembly.
The easiest way to do this is to create some simple functions and
compile them using the 'keep asm' flag set. You can then go back and
look at the resulting ASM file. I got started with simple math
functions like the one below. In this case, the ASM code is even
embedded into the C code making it especially easy. If you look in the
DSK source files you will find a number of other examples.
Hope this helps,
Best regards
Keith Larson
DSP and Analog Consulting
Lincoln Ma, 01773
#include <math.h>
float DivHll(float A,float B)
{
return(A/B);
}
float DivAsm(float A,float B); // C prototype of function
asm(" .global _DivAsm ; make this
label visible at
all linker levels ");
asm("_DivAsm ldf 3.1415,R0 ; do the stuff we need to do
");
asm("
rets
; &nbs
p; &nb
sp; ");
void main(void)
{
float A,B,C;
A=355;
B=113;
C=DivAsm(A,B);
C=DivHll(A,B);
}
zingapower wrote:
salam
i am new user of tms320c3x i need to write a c program for adaptive
noise cancellation , i have to ask u people where to start off ,anyone
of who have written c programs for this dsp ,where did they learn the
basics actually i am confused in mixed assembly and c thanx

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