> That is what I assumed from what had been said. > At startup it would be easy [tm] to fill the stack with return > addresses that all went to the same place. That is possible, am curious how many piclisters can figure out how to=20 do that. > When max stack depth is to be determined, as long as the stack has > never overrun, the current depth is known and can be would back to > zero. I think you mean: after the program has run, and has returned each call=20 it has done, you could use those 'same addresses' to to determine how=20 many stack entries were never used. > NOW another pop rolls the stack back to the top and subsequent > pops produce returns to defined locations as long as the contents have > not been destroyed. not pops, those do not exist on 14-bit cores. use RETURN. > When you strike the first "used" location the > return will not go to where you expect. > A timer can haul the system > back into control and note can be made of how many locations returned clever idea. But do you realize that the PIC stack is not circular? When you pop a=20 return address, the 'oldest' address in stack is duplicated. Your scheme could still be used, with a small change, and at the cost of=20 an extra stack entry. The solution is of course left as an exercise to=20 the reader. --=20 Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .