DSPRelated.com
Forums

Welcome to the adsp E-Mail Group

Started by step...@gel.usherb.ca August 26, 2005
The goal of this egroup is to facilitate the exchange of information between
ADSP Develloppers

Group Manager: adsp-owner@adsp...

To subscribe, send a message to adsp-subscribe@adsp... or go to the
e-group's home page at http://www.egroups.com/list/adsp


Hi,

I had this same problem with my program crashing because of too many nested
loops. What I did was to implement outer loops using just an ordinary
register as the counter and an ordinary test instead of the zero-overhead
Do..Until. I often used the af register because it was a shade faster than
using a register in data memory. I saved the zero-overhead looping for when
it was really needed.

I guess this won't be much use if you're programming something object
oriented in C :-/

{Initialise outer loop counter}
ax000;
af=pass ax0;

{Outer loop}
outerloop: cntr00;

{Inner loop:}
do innerloop until ce;
{Payload - gets executed 1 million times or thereabouts}
innerloop:

{Outer loop decrement and test}
af-1;
if gt goto outerloop; Steve Conner
http://www.optosci.com/


The original poster of this query was also asking about stack control. The
ADSP-2181 has the PUSH, POP, and TOPPCSTACK instructions- see pages 15-84
and 15-85 of the ADSP-2100 Family User's Manual. Also see page 3-9.

The instructions are not too comprehensive: The loop stack can't be pushed,
and when you pop it, the popped value goes in the "Bit bin".

Steve Conner