comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Pascal Calling Convention
Date: Mon, 28 Mar 2011 08:41:21 -0700 (PDT)
Date: 2011-03-28T08:41:21-07:00	[thread overview]
Message-ID: <b60d50e9-4aaa-4100-96fa-af4073390412@z27g2000prz.googlegroups.com> (raw)
In-Reply-To: imm75p$53o$1@munin.nbi.dk

On Mar 26, 7:24 pm, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> "Robert A Duff" <bobd...@shell01.TheWorld.com> wrote in messagenews:wccbp0xy5hu.fsf@shell01.TheWorld.com...
> ...
>
> > Thanks for the clarification.  I agree with the above, and of course I
> > agree that the stack doesn't have to be a contiguous block of memory.
> > But why do you call that "contiguous stack" thing a "hardware stack"?
> > I mean, on most architectures, push/pop are implemented by subtract/add
> > instructions on the stack pointer register.  That's not a whole lot of
> > "hardware support for stacks".  The hardware has instructions that
> > support implementing arrays, and linked lists, too, but we don't call them
> > "hardware arrays" or "hardware linked lists".
>
> > OK, on x86, there are push/pop instructions.  But most stack
> > manipulation is still just subtract/add.  Call pushes a return address.
> > Enter/leave instructions are stack-oriented, but nobody uses those,
> > because they're slow.  Maybe "the stack" on x86 could be called a
> > "hardware stack", but it's pretty marginal in practice.
>
> 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. 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've worked with several RISC machines that don't have this kind of
support, though.  There are, of course, calling conventions for those
machines that programmers follow (if they want their programs to
cooperate in any way with other software), and conventionally one
particular register is designated the stack register.  But from a
hardware standpoint, there's nothing special about the register, in
the sense that there are no instructions that operate on that register
that aren't available on all general registers, and nothing else
special about how the register is implemented in hardware (such as
being one of a few designated registers that are saved when an
interrupt occurs).  I don't know what the definition of "hardware-
supported stack" is, but it seems like having a special stack register
would be one necessary characteristic.

                              -- Adam




  reply	other threads:[~2011-03-28 15:41 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 21:37 Pascal Calling Convention Shark8
2011-03-23 23:25 ` Yannick Duchêne (Hibou57)
2011-03-24  0:24   ` Randy Brukardt
2011-03-24  0:43     ` Yannick Duchêne (Hibou57)
2011-03-24  2:04       ` Shark8
2011-03-25 15:40         ` Yannick Duchêne (Hibou57)
     [not found]       ` <F8mdnYCca6tRJBfQnZ2dnUVZ_s-dnZ2d@earthlink.com>
2011-03-24 19:20         ` Keith Thompson
2011-03-25 16:04           ` Robert A Duff
2011-03-25 17:02             ` Hyman Rosen
2011-03-25 17:09               ` Robert A Duff
2011-03-25 17:35                 ` Hyman Rosen
2011-03-26 19:51                   ` Robert A Duff
2011-03-25 17:51             ` Keith Thompson
2011-03-26 20:46               ` Robert A Duff
2011-03-27  2:24                 ` Randy Brukardt
2011-03-28 15:41                   ` Adam Beneschan [this message]
2011-03-28 19:52                   ` Robert A Duff
2011-03-29  2:32                     ` Randy Brukardt
2011-03-29  6:06                       ` Shark8
2011-03-29 23:45                         ` Randy Brukardt
2011-03-29 19:19                       ` Robert A Duff
2011-03-30  0:02                         ` Randy Brukardt
2011-03-30 12:40                           ` Robert A Duff
2011-03-30 19:40                             ` Randy Brukardt
2011-03-30 20:56                               ` tmoran
2011-03-30 22:34                                 ` Robert A Duff
2011-03-31 21:00                                   ` Randy Brukardt
2011-03-28 20:29                 ` Hyman Rosen
2011-03-28 21:16                   ` Adam Beneschan
2011-03-28 21:26                     ` Hyman Rosen
2011-03-28 22:08                       ` Adam Beneschan
2011-03-28 23:47                         ` Georg Bauhaus
2011-03-29 12:23                           ` stefan-lucks
2011-03-29 13:10                             ` Hyman Rosen
2011-03-30 13:42                             ` Phil Clayton
2011-03-31  7:40                               ` Phil Clayton
2011-03-29  2:48                         ` Hyman Rosen
2011-03-29 18:30                           ` Robert A Duff
2011-03-29 23:25                             ` Adam Beneschan
2011-03-30 12:50                               ` Robert A Duff
2011-03-30 14:47                                 ` Adam Beneschan
2011-03-30 18:10                                   ` Robert A Duff
2011-03-29  3:01                         ` Hyman Rosen
2011-03-29 18:22                           ` Robert A Duff
2011-03-26 21:30           ` Florian Weimer
2011-03-27 16:18             ` Robert A Duff
2011-03-27 16:38               ` Florian Weimer
2011-03-27 16:56                 ` Robert A Duff
2011-03-24  2:15   ` Shark8
2011-03-24  0:38 ` ytomino
2011-03-24  2:23   ` Shark8
2011-03-24 21:29 ` Gautier write-only
2011-03-25 12:47 ` Marco
2011-03-25 15:38   ` Yannick Duchêne (Hibou57)
2011-03-26  8:39     ` ObjectAda [was: Pascal Calling Convention] Gautier write-only
2011-03-26 14:05       ` Marco
2011-03-26 21:58         ` Gautier write-only
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox