From owner-freebsd-hackers Sat Mar 13 15: 5: 8 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dei.calldei.com (dei.calldei.com [205.179.37.1]) by hub.freebsd.org (Postfix) with ESMTP id CEE3514BE7 for ; Sat, 13 Mar 1999 15:05:06 -0800 (PST) (envelope-from chris@dei.calldei.com) Received: from localhost (chris@localhost) by dei.calldei.com (8.9.0/8.9.0) with ESMTP id PAA07658; Sat, 13 Mar 1999 15:09:06 -0800 (PST) Date: Sat, 13 Mar 1999 15:09:06 -0800 (PST) From: Chris Costello To: Dennis Cc: hackers@FreeBSD.ORG Subject: Re: 'C' language question In-Reply-To: <199903132232.RAA19255@etinc.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 13 Mar 1999, Dennis wrote: > > I have a memory mapped controller that requires that all of its > register reads and writes be 32 bits....the follow code: > > *reg |= 0x80000000; > > generates a byte OR (ORB instruction) which trashes the register with > gcc 2.9.2....a stupid "optimization" that happens to be wrong in this > case. > > is there a declaration that will force the compiler to generate a 32bit > OR (ORL instruction) on this? > Try using the 'asm { ... }' syntax in C. (of course, this is where your code becomes platform-specific...) > Dennis > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message