Re: Recursive Call




In article <HZfcf.64578$zb5.43562@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Arnold Trembley <arnold.trembley@xxxxxxxxxxxxxxxx> writes:
>
> Joe Zitzelberger wrote:
>
> > Even the IBM mainframe, originally a non-stack machine, made hardware
> > allowances for stack-style things (e.g. Program Call & Return) somewhere
> > in the 70's.
>
> Program Call and Return was implemented on System 370 architecture
> without hardware or software stacks, to the best of my knowledge. And
> even today, IBM Z-series mainframes still do not have hardware
> stacks, as far as I know.

Even if zSeries doesn't have a "hardware" stack (which I imagine to
mean opcodes for pushing and popping values, and a register which is
either reserved or used by convention as a stack pointer), I believe
Joe's correct that pretty much all general-purpose systems these
days at least provide some stack mechanism as part of their standard
ABI.

That's no doubt due in part to the popularity of C. C can be
implemented without a classic contiguous stack - for example using
chained activation records - but the language treats function calls,
function parameters and return values, and automatic variable
allocation and deallocation in a stack-oriented fashion, so some
relatively efficient stack mechanism is a must for a reasonable C
implementation.

There are no doubt still small embedded systems that do not provide
a stack, but these days even most embedded machines are programmed
in C or another high-level language with similar requirements.

--
Michael Wojcik michael.wojcik@xxxxxxxxxxxxxx

Do we have boyfriends? We are interested in delicious food and sweets.
And tiny animals like the cat. -- Naoko Yamano
.



Relevant Pages

  • Re: XP sometimes balks on boot-up
    ... to catch this trap. ... Memory corruption, other hardware ... The most common cause of this is hardware memory corruption. ... A kernel stack overflow. ...
    (microsoft.public.windowsxp.general)
  • Re: using MISC (post 1987 Forth hardware) opcodes
    ... This clearly had nothing to do with hardware in that an ELSE is ... Like dozens of other things Chuck explained his reasoning. ... for those interested in the conceptual foundation ... people ask why we de-emphasis the use of the stack. ...
    (comp.lang.forth)
  • Re: !p+, and thank you Jeff
    ... and looking at the SEAforth instruction set table, ... But like many other assumptions about what hardware will be ... with than mainframe style software. ... Stack depth managment is usually the biggest imaginary ...
    (comp.lang.forth)
  • Re: hardware errors, do C and Forth need different things in hardware?
    ... hardware is to people who are thinking C software ... need or want the sort of complications that this code avoids. ... If it confuses solutions for bugs it will introduce REAL bugs. ... back from the stack is greater than the size of the stack. ...
    (comp.lang.forth)
  • Re: write statement output buffer flush off on Sun
    ... > routine is usually greater than the cost of checking for a nonzero ... > are passed on the stack, passing the addresses involves memory traffic. ... branch - and it may involve additional instructions on some ... hardware, a conditional branch costs about the same whether it's ...
    (comp.lang.fortran)