Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: comp.lang.java.programmer,comp.programming Subject: Re: Creating a new stack from an exisiting one. Date: Sun, 04 Nov 2012 16:00:29 +0100 Organization: Informatimago Lines: 34 Message-ID: <87ip9ll8fm.fsf@informatimago.com> References: <0.73472d82415d5353822e.20121103155132GMT.87mwyyvg57.fsf@bsb.me.uk> <0.898697c4e5f8819c7fa0.20121104004445GMT.878vaiurgi.fsf@bsb.me.uk> <87vcdllg3u.fsf@informatimago.com> <1Juls.140915$lz1.27777@fx28.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net EvHr4EukWiVXNrHV/BA62Qqepjy8T15jYVvq+mx8WfeJ1WADOyYy3DafSuU5Bk6Tf/ Cancel-Lock: sha1:MzdiNzExN2MzYjQzNGIwNGQ1Njk1NGNjYzcxYmNiZjc1YTEzOGNiNA== sha1:IaJA4sGaZnkzL0DS/9uaOtvwcKU= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Xref: csiph.com comp.lang.java.programmer:19623 comp.programming:2464 "BartC" writes: > "Pascal J. Bourguignon" wrote in message > news:87vcdllg3u.fsf@informatimago.com... >> Ben Bacarisse writes: > >>> All this excludes any mention of the return address. Maybe that's being >>> handled separately. >> >> Well, I don't know of any processor that uses a separate stack for the >> frame pointers. > > Usually because you only need access to one at a time. The OP > mentioned a stack just for frame pointers; I assumed (perhaps > wrongly), then access to any of them might be needed at any time. If > not then a single stack will do. (Or perhaps no real stack at all, as > a software data structure seems to be used. Then, any scheme could be > employed.) Yes. And languages like C don't allow embedded functions like Pascal, so the problem solved by display records doesn't occur, and otherwise for recursive embedded functions, one can also pass the references to the outer stack frames as invisible parameters, if they're needed. So as you say, there's a single access at a time. But the important point is that it's not a pure stack, but a vector where you can access elements at given offsets. -- __Pascal Bourguignon__ http://www.informatimago.com