Re: modifying constants in Fortran and elsewhere

Thomas Koenig <tkoenig@netcologne.de>
Sun, 16 Jul 2023 13:08:07 -0000

          From comp.compilers

Related articles
modifying constants in Fortran and elsewhere gah4@u.washington.edu (gah4) (2023-07-10)
Re: modifying constants in Fortran and elsewhere tkoenig@netcologne.de (Thomas Koenig) (2023-07-15)
Re: modifying constants in Fortran and elsewhere DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2023-07-16)
Re: modifying constants in Fortran and elsewhere tkoenig@netcologne.de (Thomas Koenig) (2023-07-16)
Re: modifying constants in Fortran and elsewhere gah4@u.washington.edu (gah4) (2023-07-16)
Re: modifying constants in Fortran and elsewhere gah4@u.washington.edu (gah4) (2023-07-16)
Re: modifying constants in Fortran and elsewhere david.brown@hesbynett.no (David Brown) (2023-07-17)
Re: modifying constants in Fortran and elsewhere gah4@u.washington.edu (gah4) (2023-07-17)
| List of all articles for this month |

From: Thomas Koenig <tkoenig@netcologne.de>
Newsgroups: comp.compilers
Date: Sun, 16 Jul 2023 13:08:07 -0000
Organization: Compilers Central
References: 23-07-003 23-07-006
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="98958"; mail-complaints-to="abuse@iecc.com"
Keywords: Fortran, history, comment
Posted-Date: 16 Jul 2023 12:43:16 EDT

Our esteemed moderator wrote:


> [The constant stomping issue far predates S/360. As soon as Fortran II
> added subroutines on the 704, there were constant arguments you could
> change by mistake. The problem is that it took quite a while for people
> to sort out the differences among call by reference, call by value,
> and call by copy in/out. Fortran on the 70x and S/360 user reference
> for array arguments, copy in/out for scalars.


I just have the IBM System/360 Operating System FORTRAN IV (H)
Programmer's Guide, Fourth Edition, open (isn't Bitsavers great?).


It states, on page 108


Argument List


      The argument list contains addresses of
variables, arrays, and subprogram names
used as arguments. Each entry in the argu-
ment list is four bytes and is aligned on a
full-word boundary. The last three bytes
of each entry contain the 24-bit address of
an argument. The first byte of each entry
contains zeros, unless it is the last entry
in the argument list. If this is the last
entry, the sign bit in the entry is set on.


So, apparently no copy in/out on that particular compiler, at least.
It also shows the (ab)use that was possible of the uppermost byte,
because clearly 24 bits are enough for everybody and for all
time, right? :-)
[See the 360 Fortran IV Language manual, where on pages 90-95 it explains
copy in/out and how to avoid it by putting slashes around the dummy
argument names.


https://bitsavers.org/pdf/ibm/360/fortran/C28-6515-7_System_360_FORTRAN_IV_Language_1966.pdf


I was there, I actually used this stuff. Re abuse of the upper byte, as the size of
OS/360 exploded way past what they expected, programmers were under pressure to make
every bit and byte count, hence overloading the high byte. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.