Re: A86: Re: Parity odd,even
[Prev][Next][Index][Thread]
Re: A86: Re: Parity odd,even
>
>I haven't replied to this list for sooo long, and I don't know why I am now
>but....
>
>first my page is
>http://www.calpoly.edu/~tllilleh/a86/a86.html
>I haven't updated it for a long time, but I guess people still find it
>useful.
>
>secondly, Parity is used to count the number of '1' bits in a number.
>Parity Odd (PO) means that there are an ODD number of high bits (1's) in
the
>register
>Parity Even (PE) means that there are an EVEN number of high bits (1's) in
>the register
>It is usually used for simple but fairly useless checksums. however it can
>be used for anything that a creative programmer can come up with.
I working on a collision detection algorithm that takes two bytes w/ the bit
offsets of both boxes and stores them like findpixel stores the bit offset
(ex: %01000000, %00100000). So, the simple method for checking alignment
(eluded me some time, though) is to OR the bytes together and check parity.
the parity flag is also reset when after ldi, ldd, cpi, cpd bc decrements to
zero; after ld a,i/r , ld r/i,a contains a copy of IFF2