Re: another C-like language? was Compilers :)

gah4 <gah4@u.washington.edu>
Tue, 10 Jan 2023 15:13:33 -0800 (PST)

          From comp.compilers

Related articles
[9 earlier articles]
Re: another C-like language? was Compilers :) marblypup@yahoo.co.uk (marb...@yahoo.co.uk) (2023-01-07)
Re: another C-like language? was Compilers :) david.brown@hesbynett.no (David Brown) (2023-01-08)
Re: another C-like language? was Compilers :) DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2023-01-09)
Re: another C-like language? was Compilers :) 864-117-4973@kylheku.com (Kaz Kylheku) (2023-01-09)
Re: another C-like language? was Compilers :) Keith.S.Thompson+u@gmail.com (Keith Thompson) (2023-01-09)
Re: another C-like language? was Compilers :) david.brown@hesbynett.no (David Brown) (2023-01-10)
Re: another C-like language? was Compilers :) gah4@u.washington.edu (gah4) (2023-01-10)
Re: another C-like language? was Compilers :) tkoenig@netcologne.de (Thomas Koenig) (2023-01-11)
Re: another C-like language? was Compilers :) 864-117-4973@kylheku.com (Kaz Kylheku) (2023-01-11)
Re: another C-like language? was Compilers :) findlaybill@blueyonder.co.uk (Bill Findlay) (2023-01-11)
Re: another C-like language? was Compilers :) david.brown@hesbynett.no (David Brown) (2023-01-11)
Re: back in the 60s, another C-like language? was Compilers :) gah4@u.washington.edu (gah4) (2023-01-11)
Re: another C-like language? was Compilers :) laguest@archeia.com (Luke A. Guest) (2023-01-13)
[5 later articles]
| List of all articles for this month |

From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Tue, 10 Jan 2023 15:13:33 -0800 (PST)
Organization: Compilers Central
References: 23-01-001 23-01-002 23-01-003 23-01-008 23-01-016 23-01-029 23-01-033
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="7917"; mail-complaints-to="abuse@iecc.com"
Keywords: assembler, history, comment
Posted-Date: 10 Jan 2023 19:56:09 EST
In-Reply-To: 23-01-033

On Tuesday, January 10, 2023 at 2:16:32 PM UTC-8, David Brown wrote:


(snip)
> The point is that you do not declare a variable until you actually have
> something to put in it. You never have this semi-alive object floating
> around where it is accessible, but has no valid or known state. You
> never have an artificial initialisation, such as putting 0 in a variable
> declared at the top of the function, in the mistaken believe that it
> makes code somehow "safer".


Java requires that the compiler be able to figure out that a variable
(well, scalar variable) is given a value before it is used. Most of the
time, that works out fine. Once in a while, I know that it is given
a value, but the compiler doesn't. In that case, it is initialized
to (usually) 0, and a comment indicating why.


(snip)


> [Variables at the top probably comes from Algol60 via Pascal. For assembler,
> depends on the assembler. Lots of them let you have several sections in the
> program and switch between the code and data sections as you go. IBM mainframe
> assemblers had this feature in the 1960s. -John]


Most of the IBM mainframe assembly code I know, puts the variables
at the bottom.


Well, early on I started reading the generated code from compilers,
and not so much later, the Fortran G&H library. Maybe not the best
examples of structured code, though.


Well, if by data section you mean DSECT, I suppose.
Most I knew didn't do much of that, though.


Variables at the bottom, and use the same base register for
code and data. You could put the variables at the top, and
branch around them. I don't remember anyone doing that.


More recent processors, maybe from ESA/390 days, have
data and instruction cache, and want data and instructions
more than (if I remember) 256 bytes apart.


But okay, it is completely different for reentrant programs,
than the static allocation non-reentrant code of much of
OS/360 associated programs.
[For IBM assember, I meant that you could have one CSECT for
your code and another for your data, and you could switch
between them as you go along. For the elite few of us who
used TSS/360, a PSECT let you set the initial contents of
the RW data that the RO code in a routine used. DSECT was
somehing else, more like a structure definition. I realize
that in practice most code was not reentrant and you put
all your code and data in one section. -John]


Post a followup to this message

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