Gerhard Fiedler wrote: > At 11:43 12/23/98 -0700, Dwayne Reid wrote: > >Andy Kunz wrote: > >>A stack overflow is no problem in the real world - the stack is > circular. > > > >Sorry Andy - the stack is NOT circular (thank god)! > > > >The best way that I have come up with is to think of the stack as open > >ended. If you push too many items onto the stack, the excess items are > >lost. When popping the stack, all items move up one level; with the very > >end of the stack keeping its current value. > > isn't that exactly what one means when saying "circular"? the way it works > looks very suspiciously like a circular stack... build one, and you'll see > that works exactly like this. Gerhard's right, you've just described a circular stack. Remember that it's not the items pushed onto the stack that go in a circle, it's the pointer to the current item in the stack. Even the PIC16C7x manual says "The stack operates as a circular buffer". See the section on "PCL and PCLATH". -Ed V. Agile Controls >