Reply by bhaskar_thiagarajan August 20, 20022002-08-20
[please reply to only]
Hi Christoph
I have to admit, I didn't read your first suggestion properly.
I tried writing a simple program to see how it works, and I couldn't
compile it. I have used the register keyword before but never with an
asm() statement...can you send something that will compile?

Cheers
Bhaskar

--- In adsp@y..., Christoph Ripcke <CRipcke@m...> wrote:
> Hi Bhaskar,
>
> I don not recommend inline assembly, I recommend to hold hand on
how the
> compiler uses the CPU registers. the only "inline" is the guidance
for the
> compiler to name register to make it readable. After the register
var
> declaration you can continue with plain C and make it as readable
as you
> like to.
>
> regards
> Christoph
>
> P.S.: I know it was silly to declare length and modify register and
> pointers. Best regards from copy 'n paste
>
> -----Originalnachricht-----
> Von: bhaskar_thiagarajan
> An: adsp@y...
> Gesendet: 19.08.2002 20:44
> Betreff: [adsp] Re: SHARC Circular Buffers in C, Software Interrupts
>
> I have asked this question on this group before.
> The response I got indicate that the C compiler does not have any
> support for Circular Buffers. The macros (in macros.h) that let you
> do this are antique and may not work as advertised.
>
> Christoph's suggestion is pretty much inline assembly and isn't
> direct support in C.
>
> You are better off writing an assembly function for the routine or,
> implement a modulo buffer in C - it won't be as elegant and
certainly
> doesn't use the hardware features, but may be more readable
>
> Cheers
> Bhaskar
>
> --- In adsp@y..., Christoph Ripcke <CRipcke@m...> wrote:
> > Hi Jaime,
> >
> > all you want to know is written in manuals but here's a short
hint.
> >
> > circular buffers (buffer 7 example):
> >
> > {
> > register unsigned int *I7 asm ( "i7" ); // index
> > register unsigned int *L7 asm ( "l7" ); // length of buffer
> > register unsigned int *B7 asm ( "b7" ); // base address of
> buffer
> > register unsigned int *M7 asm ( "m7" ); // modifier to use
> >
> > /*
> > * what U want to do
> > */
> > }
> >
> > make sure that the compiler won't use the registers you use. In
the
> compiler
> > setting tabs you can list those registers.
> >
> >
> > For user software interrupts have a look at library function
> interrupt(f,s),
> > signal and raise. Last two are used for triggering software
> itnerrupts.
> >
> > regards
> > Christoph
> >
> >
> > -----Originalnachricht-----
> > Von: jaime_aranguren
> > An: adsp@y...
> > Gesendet: 18.08.2002 17:03
> > Betreff: [adsp] SHARC Circular Buffers in C, Software Interrupts
> >
> > Hello,
> >
> > Could please anyone give me information on how to use Circular
> > Buffers in C
> > for the SHARC?
> >
> > Also need guidance on how to setup and use User Software
Interrupts
> > (in C)
> > for the SHARC.
> >
> > Using VDSP++ 2.0 for SHARC.
> >
> > Thanks a lot
> >
> > --
> >
> > ----------------
> > Jaime Andr Aranguren Cardona
> > jaime.aranguren@i...
> > jaime.aranguren@c...
> >
> >
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email client, only the
> author
> > of this message will receive your answer. You need to do
a "reply
> all"
> > if you want your answer to be distributed to the entire group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join: Send an email to adsp-subscribe@y...
> >
> > To Post: Send an email to adsp@y...
> >
> > To Leave: Send an email to adsp-unsubscribe@y...
> >
> > Archives: http://groups.yahoo.com/group/adsp
> >
> > Other Groups: http://www.dsprelated.com/groups.php3
> >
> >
> > ">http://docs.yahoo.com/info/terms/ >
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the
author
> of this message will receive your answer. You need to do a "reply
all"
> if you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to adsp-subscribe@y...
>
> To Post: Send an email to adsp@y...
>
> To Leave: Send an email to adsp-unsubscribe@y...
>
> Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/