From: Adam Beneschan <adam@irvine.com>
Subject: Re: segfault with large-ish array with GNAT
Date: Fri, 19 Mar 2010 14:50:20 -0700 (PDT)
Date: 2010-03-19T14:50:20-07:00 [thread overview]
Message-ID: <e14409a6-15e6-482b-8ff5-f0ec078953a5@k4g2000prb.googlegroups.com> (raw)
In-Reply-To: m2bpeknq9p.fsf@pushface.org
On Mar 19, 11:02 am, Simon Wright <si...@pushface.org> wrote:
> tmo...@acm.org writes:
> > IIRC, the Burroughs 6500 had what they called a "cactus stack" where
> > branching would occur for new threads. And there was a Texas Instruments
> > microprocessor that had no real stack, but rather a set of registers
> > that could be saved to RAM on a subroutine call.
> > These preceded DOS.
>
> The PDP-8 worked like that; the JMS instruction stored the return
> address in the first word of the subroutine, execution started at the
> next word.
>
> JMS FOO / CALL SUBROUTINE FOO
>
> FOO, +0 / STORED RETURN ADDRESS
> ...
> JMP I FOO / RETURN
>
> (we only had capitals)
>
> --S
Isn't that approximately how all computers used to work? Or at least
a lot of them? When I was first learning how computers ran, it seemed
like the common thing was for jump instructions to save the address of
the next instruction in a register, and then the subroutine code would
store the register somewhere---perhaps in the location containing the
return jump, since I don't remember those computers having "indirect
jump" instructions either. It was a few years before I encountered a
machine that automatically saved return addresses on a stack---or even
had a concept of a stack built into it.
One thing I remember was a particular computer's implementation of
COBOL (Honeywell 200/2000 series---my dad used to work for Honeywell
so those were some of the computers I was most familiar with). COBOL
used PERFORM statements for subroutine calls, and since you could have
PERFORM A in one part of the program and PERFORM A THROUGH B in
another part, or you could just fall into A without a PERFORM, the
paragraph A couldn't tell whether it was supposed to return to the
caller at the end of the paragraph. So the code, before it did a
PERFORM A, would do a "move" to move a branch instruction into a
location at the end of A that would branch back to the caller. Then,
after it returned, it would do another "move" to move a no-op to that
location.
Of course, none of these were good with recursion but I don't think
the experts understood the importance of recursion back then.
-- Adam
next prev parent reply other threads:[~2010-03-19 21:50 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-17 19:21 segfault with large-ish array with GNAT Jerry
2010-03-17 19:36 ` Gautier write-only
2010-03-17 19:58 ` Georg Bauhaus
2010-03-18 6:45 ` Jerry
2010-03-18 7:52 ` Ludovic Brenta
2010-03-18 23:57 ` Robert A Duff
2010-03-18 10:13 ` Jeffrey Creem
2010-03-18 10:23 ` Ludovic Brenta
2010-03-19 0:44 ` Jerry
2010-03-18 19:51 ` Adam Beneschan
2010-03-18 14:44 ` John B. Matthews
2010-03-19 4:44 ` Jeffrey R. Carter
2010-03-19 8:14 ` John B. Matthews
2010-03-18 15:36 ` Gautier write-only
2010-03-18 16:46 ` tmoran
2010-03-18 19:11 ` Warren
2010-03-18 17:03 ` Warren
2010-03-18 20:38 ` Maciej Sobczak
2010-03-19 13:26 ` Charmed Snark
2010-03-19 17:27 ` tmoran
2010-03-19 18:02 ` Simon Wright
2010-03-19 20:10 ` Warren
2010-03-19 21:50 ` Adam Beneschan [this message]
2010-03-19 20:24 ` Warren
2010-03-19 20:38 ` Warren
2010-03-19 8:31 ` Ludovic Brenta
2010-03-19 13:20 ` Warren
2010-03-19 12:04 ` Brian Drummond
2010-03-19 19:22 ` Jerry
2010-03-19 20:22 ` Jeffrey R. Carter
2010-03-19 23:24 ` Jerry
2010-03-20 0:25 ` Jeffrey R. Carter
2010-05-07 21:58 ` Raising the stack limit (was: segfault with large-ish array with GNAT) Björn Persson
2010-03-17 19:57 ` segfault with large-ish array with GNAT jonathan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox