
Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).
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
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