piclist 2001\01\26\115958a >
Thread: Stack Overflows
www.piclist.com/techref/microchip/devices.htm?key=pic
flavicon
face BY : Dan Michaels email (remove spam text)



Roman wrote:
........
{Quote hidden}

Forget it. Recursive routines generally use the stack
to store "local" variables, and if too many levels are in
use, you can easily overflow it with your data, besides
return addresses -[on older 80x86, at least]. And If you
only use global variables, then you would be continually
overwriting them - also called non-re-enterable routines,
the bane of M$-DOS and other non-multitasking OSes.

Existence of the circular stack on some PICs, however
means you can use a s.w. bailout to go to the beginning of
your program from "anywhere" in your code - no matter what
is already on the stack. I use this method to bailout of
some routines that are so tightly coded that there isn't
space to add a < btfs_ + goto >. [this is probably the
place Olin just said he didn't want to go to].

- danM

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamKILLspammitvma.mit.edu


<1.5.4.16.20010126095554.37cf4e42@pop.dnvr.uswest.net>

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Stack Overflows

month overview.

new search...