??? 03/24/06 08:52 Read: times |
#112941 - calculating parity.. Responding to: ???'s previous message |
I've found this trick on the net sometime in the past..
v = the_byte_value; v ^= v >> 4; v &= 0xf; parity = (0x6996 >> v) & 1; of course, the 8051 isn't too efficient with shifting or 16-bit values, so the most efficient way is to move the wanted value to accumulator and reading parity from psw.. |