Date: Mon, 14 Jul 1997 09:04:52 +0000 From: Bill Currie Subject: Re: odd or even # of 1's (was: no subject) To: Nate Eldredge Cc: djgpp AT delorie DOT com, chirayu AT poboxes DOT com, kuku AT gilberto DOT physik DOT rwth-aachen DOT de Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <33C9EBB4.35D3@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <199707120535 DOT WAA15640 AT adit DOT ap DOT net> Precedence: bulk Nate Eldredge wrote: > > Well, I hate to rain on everybody's parade here, but the Intel `80386 > Programmer's Reference Manual' says this about the parity flag: > > Parity Flag -- Set if low-order eight bits of result contain an even number > of 1 ^^^^^^^^^^^^^^^^^^^^ > bits; cleared otherwise. > > So the parity flag only shows the parity of the low byte. It would be > theoretically possible to check each byte of the int with this scheme and > then combine your results, but it would doubtless be ugly and probably > slower than the shift method. Bummer! Just verified it too. > > Sorry. :-( Hey, that's all right. Better you than the cpu giving appearently wrong results! Bill -- Leave others their otherness.