Path: csiph.com!usenet.pasdenom.info!aioe.org!rt.uk.eu.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer,comp.programming Subject: Re: Creating a new stack from an exisiting one. Date: Sun, 4 Nov 2012 19:56:19 +0000 (UTC) Organization: UK Free Software Network Lines: 32 Message-ID: References: <0.73472d82415d5353822e.20121103155132GMT.87mwyyvg57.fsf@bsb.me.uk> <0.898697c4e5f8819c7fa0.20121104004445GMT.878vaiurgi.fsf@bsb.me.uk> <87vcdllg3u.fsf@informatimago.com> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1352058979 2563 84.45.235.129 (4 Nov 2012 19:56:19 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Sun, 4 Nov 2012 19:56:19 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com comp.lang.java.programmer:19629 comp.programming:2468 On Sun, 04 Nov 2012 13:14:45 +0100, Pascal J. Bourguignon wrote: > Well, I don't know of any processor that uses a separate stack for the > frame pointers. See for example the instructions LINK and UNLK of the > 680x0 (there are similar instructions on X86 and others). The top frame > pointer is usually kept in A6, while the stack pointer is A7=SP. > I can name two for you. Both are Motorola parts, though they belong to different chipsets: MC6809 ====== - an 8/16 bit chip, has two stack pointers, S and U. Both can be mapped anywhere in RAM. The S pointer is used during subroutine calls, while the U pointer is available for use as a secondary stack: unlike the S pointer, there are no automatic operations tied to it, so it will only be be changed by user-written instructions such as PSHU, PULU, LEAU and LDU. MC68000 =======, its variants and derivatives, e.g. 68000, 68008, 68020, 68030 and 68040. These have a file of 8 32 bit address registers. In a similar way to the 6809, any or all of the 8 can be used as stack pointers, i.e. all can by the subject of push and pop instructions, but D7 (also referred to as SP) is used as the system stack for subroutine calls, etc. HTH -- martin@ | Martin Gregorie gregorie. | Essex, UK org |