Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3380

Re: C arithmetic, was Software proofs, was Are there different

From gah4 <gah4@u.washington.edu>
Newsgroups comp.compilers
Subject Re: C arithmetic, was Software proofs, was Are there different
Date 2023-02-11 00:01 -0800
Organization Compilers Central
Message-ID <23-02-039@comp.compilers> (permalink)
References (3 earlier) <23-02-025@comp.compilers> <23-02-026@comp.compilers> <23-02-029@comp.compilers> <23-02-032@comp.compilers> <23-02-035@comp.compilers>

Show all headers | View raw


(snip, I wrote)

> But also, the 704 Fortran, and I believe still the 7090,
> indexes arrays from the end of memory toward the beginning.

And or moderator wrote:
> [It did because for reasons I have never been able to figure out,
> the 70x series subtracted rather than added the contents of
> an index register to get the effective address. -John]

I suppose so, but it was also convenient. Compilers (or linkers)
generate code starting from the bottom of memory, and allocate
variables starting from the top. (Different for different sized
machines.) Since Fortran COMMON can be different length, or at least
blank COMMON in later versions, allocating it from the end of memory
works well.

You can extend common from one subroutine to the next, or with
chaining, to another whole program.

So, was Fortran designed around the hardware,
to allocate memory from the end?

Or maybe just lucky.
[Fortran was definitely designed around the 704. I have done a lot of
looking to try and find out where the subtracted index registers came
from, and while there are a lot of guesses, there is nothing written
down. The three index registers were 1,2, and 4, and if you specified
more than one, it OR'ed them together and subtracted the result, which
was really strange. There were a lot of other machines with index
registers but none I know of that subtracted or OR'ed. I have also
been unable to tell whether the OR'ing was deliberate or just a result
of minimizing the number of tubes that they then documented.  It was
likely useless since the 7094 had 7 index registers and a flag in
case you wanted the old behavior. -John]

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Are there different programming languages that are compiled to the same intermediate language? Martin Ward <mwardgkc@gmail.com> - 2023-01-31 14:04 +0000
  Re: Are there different programming languages that are compiled to the same intermediate language? arnold@freefriends.org (Aharon Robbins) - 2023-02-01 08:07 +0000
    Re: Software proofs, was Are there different programming languages that are compiled to the same intermediate language? Spiros Bousbouras <spibou@gmail.com> - 2023-02-05 15:14 +0000
      Re: C arithmetic, was Software proofs, was Are there different Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-02-05 16:14 -0800
        Re: C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-06 13:26 -0800
          Re: C arithmetic, was Software proofs, was Are there different Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2023-02-07 14:31 +0100
            Re: C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-08 01:10 -0800
              Re: C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-09 00:26 -0800
                Re: C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-11 00:01 -0800
                Re: C arithmetic, was Software proofs, was Are there different drb@ihatespam.msu.edu (Dennis Boone) - 2023-02-12 04:37 +0000
            Re: C arithmetic, was Software proofs, was Are there different anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2023-02-08 10:19 +0000
              Re: C arithmetic, was Software proofs, was Are there different Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2023-02-10 19:11 +0100
                Re: C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-10 23:47 -0800
                Re: C arithmetic, was Software proofs, was Are there different anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2023-02-11 22:34 +0000
                Re: old floating point, C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-11 22:48 -0800
            Re: C arithmetic, was Software proofs, was Are there different Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2023-02-08 15:24 +0100
              Re: C arithmetic, was Software proofs, was Are there different gah4 <gah4@u.washington.edu> - 2023-02-09 00:37 -0800

csiph-web