On Mon, 18 Oct 1999, Paul B. Webster VK2BZC wrote: > Dr. Imre Bartfai wrote: > > > I have a maybe silly question, but I did not found any answer in the > > manuals. The question: > > Does the watchdog reset clean up the PIC return stack or not? > > Yeah, considering the operation of the PIC stack, the question is a > trifle silly. > > AFAIK or at least I *presume* it resets the internal stack pointer, > but doesn't clear the registers. But one must ask: Why would it ever > matter? Here is the background: I'm programming in PIC BASIC Pro. At a particular point of program, I need to reset the processor completely. I tought, a simple Jmp $ would do it. However, it is tedious to implement it in Basic as it inserts the necessary ClrWdt instrucions wherever it fits. So far, so good, I'll do in in inline assembly. However, it is possible only CALL an assembly label, a GOTO or equivalent is not allowed. And that was the question: CALL Reset . . ASM _Reset Jmp _Reset causes a WDT reset, indeed. However, I do more CALLs such way then RETURNs (exactly the opposite you write). So, I can achieve a stack overflow - if I repeat this process and - WDT does not clean up the stack That is why I asked. Regards, Imre > > The stack is circular, and if you ever perform more RETURNS than you > have CALLed, you will be "doing a Star Trek". > -- > Cheers, > Paul B. > >