Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!aioe.org!.POSTED!not-for-mail From: Walter Banks Newsgroups: comp.lang.forth Subject: Re: Metrics on stack usage Date: Tue, 16 Sep 2014 14:41:08 -0400 Organization: Aioe.org NNTP Server Lines: 34 Message-ID: <54188444.87C0B4CB@bytecraft.com> References: <541855C0.2558D27D@bytecraft.com> <3a80ad9d-4b38-4db4-96c6-e3adcffefacb@googlegroups.com> NNTP-Posting-Host: YoO9jN9ybQgjv0MfopP4oQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Mailer: Mozilla 4.79 [en]C-CCK-MCD NSCPCD479 (Windows NT 5.0; U) X-Accept-Language: en X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:33390 barrym95838@yahoo.com wrote: > On Tuesday, September 16, 2014 8:21:35 AM UTC-7, Walter Banks wrote: > > I am working on a code generator for a stack processor. > > Who better to ask about real stack requirements than a forth group. > > > > The question is what is the expected stack requirements for a > > forth implementation? > > The bewildering variety of possible applications makes a simple > answer difficult. Perhaps the best way would be to write a > simulator, initialize a large stack space with a unique bit > pattern, and feed it the heaviest program you can find. A > post-mortem stack dump should give you your answer. My friend > Garth did that for his embedded 65802 work-bench computer, and > came to the conclusion that 256 bytes was way more than enough > for each of his two forth stacks, but he wasn't doing GUIs or > anything fancy. > > http://www.mosaic-industries.com/embedded-systems/c-ide-software-development/codeblocks-gnu-c-gcc-compiler/c-library-hcs12-9s12/stack-space > The answer is going to be a statistical range at best. One number I do have for conventional embedded systems is I have seen one commercial application that had more than 14 return levels and about a half dozen that had 14 levels. The one with more than 14 levels could have been re-written to 6 levels. The question of how much stack space was needed is still statistical mix of how much actual data was on the stack. w..