www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/13/17:09:46

Date: Mon, 14 Jul 1997 09:04:52 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: odd or even # of 1's (was: no subject)
To: Nate Eldredge <eldredge AT ap DOT net>
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
References: <199707120535 DOT WAA15640 AT adit DOT ap DOT net>

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019