Path: utzoo!utgpu!watmath!clyde!att!rutgers!deimos!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: const, volatile, etc [was Re: # Message-ID: <225800096@uxe.cso.uiuc.edu> Date: 3 Dec 88 15:59:00 GMT References: <21560@apple.Apple.COM> Lines: 16 Nf-ID: #R:apple.Apple.COM:21560:uxe.cso.uiuc.edu:225800096:000:522 Nf-From: uxe.cso.uiuc.edu!mcdonald Dec 3 09:59:00 1988 >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 >even with optimization off. This sucks - it reads the register twice, >XORs the two (possibly different) values, and then writes the possibly >non-zero value. Oh my. This really is a disaster. Is this legal behaviour? ANSI people, what about it. (Luckily my machine can't xor memory with itself - or subtract it. But it can increment it or decrement.)