Sujet : Re: The joy of FORTRAN-like languages
De : peter_flass (at) *nospam* yahoo.com (Peter Flass)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 30. Sep 2024, 22:19:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1780944966.749420156.476631.peter_flass-yahoo.com@news.eternal-september.org>
References : 1 2 3 4 5 6 7 8 9
User-Agent : NewsTap/5.3.1 (iPad)
Charlie Gibbs <
cgibbs@kltpzyxm.invalid> wrote:
On 2024-09-29, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Sun, 29 Sep 2024 04:26:08 GMT, Charlie Gibbs wrote:
That's assuming your machine has a stack, which the IBM 360 didn't.
Presumably there was a software-defined stack in the ABI. Otherwise how
would a language like PL/I handle recursion?
The subroutine calling convention required the calling program
to pass a pointer to a register save area. A recursive routine
would have to allocate a save area in each instance (and, of
course, free it before exiting). If they wanted local variables,
they'd have to allocate and free them as well.
Presumably local variables would be allocated together with the save area.
All the assembler code I wrote used GETMAIN/FREEMAIN, then I had a
head-slapping moment a few years ago when someone said “just allocate a big
chunk of memory and allocate save areas from it to eliminate lots of SVCs.”
Of course this only makes sense when your assembler code has lots of
internal calls, not for small stand-alone subroutines.
-- Pete