From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2cb1f0b6d642e1dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Mon, 28 Mar 2011 15:52:56 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <9b04626e-567d-408c-aab3-39b964b3ffd6@l2g2000prg.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1301341976 2857 192.74.137.71 (28 Mar 2011 19:52:56 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 28 Mar 2011 19:52:56 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:SeBRbVIbCaTeUXurUXNjqIJ2wBw= Xref: g2news1.google.com comp.lang.ada:18548 Date: 2011-03-28T15:52:56-04:00 List-Id: "Randy Brukardt" writes: > I can't speak for Keith, but most of the hardware architectures that I've > worked on have had at least some architectual support for a "hardware" > stack. Not only the Push/Pop instructions of the X86 for instance, but also > the special SS stack segment register. True, but nobody uses the SS register in any nontrivial way, anymore. The segmentation stuff of 8086 is pretty much vestigial at this point. >...The 68K also had a dedicated stack > register and some special instructions for call/ret. Even the Unisys U2200 > mainframe had a stack segment and special instructions for call/ret and > stack frames. > > I agree that these things aren't that different than add or subtract, but > given the way that they're documented (as a hardware-supported stack in each > case), I think it is pretty obvious that these things exist. (Inventing your > own terminology and ignoring the standard view of an architecture is a good > way to confuse everyone who talks to you...) But we're not talking about "an architecture". We're talking about the implementation of Ada (or any other language that has LIFO call semantics -- no full closures, continuations...). On ANY architecture. As Adam pointed out in another reply, many machines have a stack pointer register, but purely as a software convention. On such machines, one still usually implements the stack as a contiguous region of memory, with the SP pointing to the top. I don't want to call that thing a "hardware stack" -- rather, "contiguous stack" or something. (Even there, GNAT has a secondary stack, which is a linked list in at least some cases. Not a linked list of call frames, but a linked list of memory blocks, each of which can contain multiple call frames.) And somebody (Hyman, I think) pointed to some IBM machines where the stack is normally implemented as a linked list. Still a stack, in my book. "Stack" is a pretty well-understood term in computer science, and I think if an x86-centric person insists that "the stack" must be a certain way based on the hardware/architecture, they're the one inventing confusing terminology. Keith is trying to clarify, by calling that contiguous thing a "hardware stack", but I'm saying the word "hardware" doesn't capture the intended meaning. - Bob