Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site bnl.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!cmcl2!philabs!sbcs!bnl44!bnl!stern
From: stern@bnl.UUCP (eric)
Newsgroups: net.lang.c
Subject: Re: register variables
Message-ID: <135@bnl.UUCP>
Date: Sun, 7-Jul-85 16:45:58 EDT
Article-I.D.: bnl.135
Posted: Sun Jul  7 16:45:58 1985
Date-Received: Thu, 11-Jul-85 04:51:54 EDT
References: <472@crystal.UUCP> <365@umcp-cs.UUCP> <421@osu-eddie.UUCP> <686@cadovax.UUCP>
Distribution: net
Organization: Brookhaven National Lab. Upton, N.Y.
Lines: 36

> In article <421@osu-eddie.UUCP> pritch@osu-eddie.UUCP (Norman Pritchett) writes:
> >Just for the sake of information, VMS ignores register declarations and
> >automatically decides for itself how frequently you use each variable and
> >whether or not to make it a "register declaration".  I personally don't
> >think this is the wisest approach but after looking at a number of machine
> >code listings it actually appears to work well under most conditions.
> >
> >Norm Pritchett
> >UUCP:   cbosgd!osu-eddie!pritch
> 
> So what happens then if you are frequently referencing a memory mapped
> device register, will the VMS compiler cache the first reference in a
> register?  (Note that I am aware of the proposed 'volatile' definition
> in the standard).  Or can you tell the compiler to listen to register
> definitions in certain cases.
> 
> -- 
> --------------------------------------------------------------
> Brent E. Rector - CONTEL CADO, Torrance, CA
> { decvax, hplabs, ihnp4, ucbvax, sdcrdcf }!trwrb!cadovax!brent
> 					 philabs!cadovax!brent

The VAX-11C compiler already supports volatile declarations, as
well as variables defined in readonly storage.  In addition,
to avoid allocating program sections (of which there are a
limited number), You can define entry points in your program,
and reference entry points in other programs.  This last feature
is only of use under VMS, since the concept of external names
is totally different between VMS and Unix.


					Eric Stern
					stern@bnl.arpa
					stern@bnl.bitnet
					stern@bnldag.bitnet (new)
					...!philabs!sbcs!bnl!stern