From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,255a2533fba89f5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-17 17:39:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!sdd.hp.com!usc.edu!attla2!ip.att.net!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Calculate and set Parity References: <3d879cde.85767138@news.cis.dfn.de> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1032308235 12.234.13.56 (Wed, 18 Sep 2002 00:17:15 GMT) NNTP-Posting-Date: Wed, 18 Sep 2002 00:17:15 GMT Organization: AT&T Broadband Date: Wed, 18 Sep 2002 00:17:15 GMT Xref: archiver1.google.com comp.lang.ada:29097 Date: 2002-09-18T00:17:15+00:00 List-Id: The XOR of the parities equals the parity of the XORed bytes. Thus the code can be shortened: > MOV AL, DataLo ; load a byte > AND AL, AL ; set PF change AND above to XOR AL,DataHi > LAHF ; load flags byte > SHR AH, 2 ; shift PF into bit 0 > AND AH, 1 ; mask off all other bits > MOV DL, AH ; result into DL drop the following lines > MOV AL, DataHi > AND AL, AL > LAHF > SHR AH, 2 > AND AH, 1 > XOR DL, AH ; parities must be XORed to get cumulative result