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 | Circular buffer in C and asm

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

  

Post a new Thread

Circular buffer in C and asm - steh...@hotmail.com - Aug 9 9:10:06 2007



Hi,
I have delared a structure in C. I will use its vars in asm file. I want to use one of its
array member variables as circular buffer. How can I declare it as a circular buffer in C. I
have tried to declare an array in C and then tried to use it as circular buffer in asm, but it
didnot work.

The other solution can be to declare the whole structure in assembly. I cant find a way for
doing that. Can anyone suggest a way out,

Thanks and Regards,
Saba



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

Re: Circular buffer in C and asm - Andor Bariska - Aug 22 2:43:25 2007

Saba wrote:
>
> Hi,
> I have delared a structure in C. I will use its vars in 
> asm file. I want to use one of its array member variables 
> as circular buffer. How can I declare it as a circular 
> buffer in C. I have tried to declare an array in C and 
> then tried to use it as circular buffer in asm, but it 
> didnot work.
> 
> The other solution can be to declare the whole structure 
> in assembly. I cant find a way for doing that. Can anyone 
> suggest a way out,

Declaring and using circular buffers in assembly is easy:

<code>
.VAR circular_buffer_data[128];

...

b0=circular_buffer_data;
l0=length(circular_buffer_data);
</code>

Now you you use the pointer i0 as a circular buffer pointer. If you 
set l0 to zero, then i0 becomes a linear buffer pointer. You'll find 
more in the manual.

Regards,
Andor



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