The problem would be stopping when you make it back to the top. --- James Newton (PICList Admin #3) mailto:jamesnewton@piclist.com 1-619-652-0593 PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Roman Black Sent: Friday, January 26, 2001 03:30 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Stack Overflows Bob Ammerman wrote: > > How the stack behaves on underflow/overflow depends on the particular flavor > of PIC. > > See your datasheet. > > Here are a couple examples: > > for the 16F87x (which has an 8 slot stack) the datasheet says: > > "The stack operates as a circular buffer. This means that > after the stack has been PUSHed eight times, the ninth > push overwrites the value that was stored from the first > push. The tenth push overwrites the second push (and > so on)." Yep, I knew it was a circular stack, but when I read your post a funny thought occured to me. Since the stack is circular, you could call a function ANY amount of times, and return the same amount of times, provided: * It was originally called from the top level * no ints or other functions were called. This would give an option to do a recursive activity a very large number of times?? Any opinions?? :o) -Roman -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu