DSPRelated.com
Forums

Problem With Nested Loop.

Started by mahtab alam August 25, 2005

Dear Members,

                I am using ADSP (218x) Series, Visual DSP ++3.0, and version 6.0.0.0. I have to implement more than 4 loops ( nested ). Can anyone have an idea about how I can read the Stack ( Loop Stack, Counter Stack). Actually I want to save the previous addres (The First Address of Loop ) and counter value which are placed in loop stack and counter stack respectively. Thanks for any kind of help .

Regard.

Mahtab Alam.

Design Engineer

 


Start your day with Yahoo! - make it your home page

I don't know about the 218x, but on the SHARC, you can access CURLCNTR and
LADDR (and LCNTR) just as you would any other registers to save them, etc..
After they are saved, there is a POP LOOP assembly instruction which removes
them from the stack. Again with the SHARC, looping also uses the PC stack to
store the top-of-loop address, so you will want to save/restore that as well.
The PCSTK register and the POP PCSTK instruction deal with that. Things can
get messy if you have loops that call other functions (and hence use the
PCSTK), but hopefully you won't have to deal with that.

I'm guessing that the 218x has similar registers instructions (possibly with
different names). Read the section on looping very carefully for a description
of how the loops work. Once that is well-understood, you should be able to
save/restore them.

--- mahtab alam <malam_sn@mala...> wrote:

>
>
> Dear Members,
>
> I am using ADSP (218x) Series, Visual DSP ++3.0, and version
> 6.0.0.0. I have to implement more than 4 loops ( nested ). Can anyone have an
> idea about how I can read the Stack ( Loop Stack, Counter Stack). Actually I
> want to save the previous addres (The First Address of Loop ) and counter
> value which are placed in loop stack and counter stack respectively. Thanks
> for any kind of help .
>
> Regard.
>
> Mahtab Alam.
>
> Design Engineer > ---------------------------------
> Start your day with Yahoo! - make it your home page

____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs