Path: utzoo!utgpu!watmath!clyde!att!rutgers!gatech!bloom-beacon!oberon!skat.usc.edu!blarson From: blarson@skat.usc.edu (Bob Larson) Newsgroups: comp.lang.c Subject: Re: const, volatile, etc [was Re: #defines with parameters] Message-ID: <13784@oberon.USC.EDU> Date: 3 Dec 88 08:22:48 GMT References: <674@quintus.UUCP> <117@halcdc.UUCP> <468@auspex.UUCP> <9016@smoke.BRL.MIL> <10919@ulysses.homer.nj.att.com> <377@chem.ucsd.EDU> <21560@apple.Apple.COM> Sender: news@oberon.USC.EDU Reply-To: blarson@skat.usc.edu (Bob Larson) Distribution: eunet,world Organization: USC AIS, Los Angeles Lines: 24 In article <21560@apple.Apple.COM> desnoyer@Apple.COM (Peter Desnoyers) writes: >pet peeve - It is a common thing to have to write a zero to a device >register. The obvious code, (* reg_addr) = 0, often results in: > > xor reg_addr, reg_addr What machine is this for? 3 memory references for a simple clear doesn't seem very good to me. Most 68000 compilers would use the clr instruction, which does have the undesired side effect of doing an (ignored) read though. >Unfortunately I don't think specifying bus semantics is within the >purview of the ANSI committee (please correct me if I'm wrong - my >knowledge of the details of the standard is limited) and volatile is >not sufficient to force the desired activity. Fortunatly you are wrong, and volitile is sufficient. -- Bob Larson Arpa: Blarson@Ecla.Usc.Edu blarson@skat.usc.edu Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson Prime mailing list: info-prime-request%ais1@ecla.usc.edu oberon!ais1!info-prime-request