Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Thomas Koenig Newsgroups: comp.compilers Subject: Re: modifying constants in Fortran and elsewhere Date: Sun, 16 Jul 2023 13:08:07 -0000 Organization: Compilers Central Sender: johnl%iecc.com Approved: comp.compilers@iecc.com Message-ID: <23-07-008@comp.compilers> References: <23-07-003@comp.compilers> <23-07-006@comp.compilers> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" 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 X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:3504 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]