On Wed, Dec 18, 2024 at 3:32 PM Stephen Adolph <[email protected]> wrote:

> Hi all you assembly programmers.
>
> I'm trying to code up a fast way to calculate parity of an 8 bit value
> without relying on the parity flag itself.
>
> I have a solution that is abut 40 bytes long and is a loop that checks
> each bit and manually calculates parity bit.
>
> Is there a quick way I am missing?
>
>
You're saying you cannot use the built in parity flag.

I guess the other way would be lookup table with parities pre-computed if
you can afford the space.

32 byte bit array (parity value at each bit position mapping to 256
possible bytes?
or 256 byte table  (0 or 1 in each spot) for shorter code, direct lookup.

-- John.


>

Reply via email to