Sujet : Re: The joy of FORTRAN-like languages
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 30. Sep 2024, 13:11:30
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vde4hi$268qv$24@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 29/09/2024 21:15, Peter Flass wrote:
The Natural Philosopher <tnp@invalid.invalid> wrote:
On 29/09/2024 05:26, Charlie Gibbs wrote:
On 2024-09-28, The Natural Philosopher <tnp@invalid.invalid> wrote:
>
On 28/09/2024 22:20, John Levine wrote:
>
C was in the sweet spot of being not all that great, but better than
any of the plausible alternatives at the time.
>
As far as I was concerned it was heaven. Assembler but 10x faster to
actually write.
And the way it used local variables was magic. Very hard to use the
stack as a scractc pad in assembler - you have to keep track of so many
offsets
>
That's assuming your machine has a stack, which the IBM 360 didn't.
>
>
Well there are probably other ways to implement a stack than having it
built into a computer.
Like a having a general purpose register reserved for a stack pointer
and manually creating push pop call and return as macros
>
I don't see how you can run any code that needs to do subroutines
without some form of stack.
>
Done for years before stacks were invented. You just can’t have RECURSIVE
subroutines, or at least not without a lot of work. A fairly common calling
convention, used on the 1130, saves the “next” address after the CALL in
the first word of the subroutine and jumps to the second. Arguments follow
the CALL, so you can access them using the saved word, otherwise the return
address, as an index. If you want recursion you have to stash the return
address somewhere.
In my terms that is 'some form of stack' :-)
-- "Strange as it seems, no amount of learning can cure stupidity, and higher education positively fortifies it." - Stephen Vizinczey