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-18 13:25:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!fu-berlin.de!uni-berlin.de!pc-62-31-50-169-cr.blueyonder.co.UK!not-for-mail From: nickroberts@blueyonder.co.uk (Nick Roberts) Newsgroups: comp.lang.ada Subject: Re: Calculate and set Parity Date: Wed, 18 Sep 2002 20:25:53 GMT Organization: AdaOS Message-ID: <3d88df22.168279476@news.cis.dfn.de> References: <3d879cde.85767138@news.cis.dfn.de> NNTP-Posting-Host: pc-62-31-50-169-cr.blueyonder.co.uk (62.31.50.169) X-Trace: fu-berlin.de 1032380748 4391798 62.31.50.169 (16 [25716]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:29129 Date: 2002-09-18T20:25:53+00:00 List-Id: On Wed, 18 Sep 2002 00:17:15 GMT, tmoran@acm.org strongly typed: >The XOR of the parities equals the parity of the XORed bytes. >Thus the code can be shortened: >... Absolutely correct. I forgot this in my haste (and the lateness of the hour). The revised code then is: MOV AX, Data ; load a 16-bit word XOR AL, AH ; XOR upper byte with lower ; and at the same time set PF LAHF ; load flags byte SHR AH, 2 ; shift PF into bit 0 AND AH, 1 ; mask off all other bits which leaves the result in AH. -- Nick Roberts Per Ardua ad Disastra