Date: Fri, 11 Jul 1997 08:27:47 +0000 From: Bill Currie Subject: Re: odd or even # of 1's (was: no subject) To: Christoph Kukulies Cc: "Chirayu Krishnappa (chirayu AT poboxes DOT com)" , djgpp AT delorie DOT com Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <33C5EE83.1FD1@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <19970710152801 DOT 34479 AT gil DOT physik DOT rwth-aachen DOT de> Precedence: bulk Christoph Kukulies wrote: > You could do an inline assembly operation like or'ing the integer > to itself and examine the PF (parity flag) of the EFLAGS CPU > register afterwards, e.g. by a JPE (conditional jump short on parity even > PF=1). You'ld be better off using 'setpe' rather than 'jpe', as it't much less expensive: asm volatile("or %1,%1;setpe %b0":"=g"(result):"r"(value):"cc"); Bill -- Leave others their otherness.