In Picbasic Pro,
a var word
b var word
c var word
c = a ^ b
But using PC to calculate XOR between a and b, I got a different value than c above.
In both of these cases, when I XOR the result back with b, I can get back a.
Any idea?
Printable View
In Picbasic Pro,
a var word
b var word
c var word
c = a ^ b
But using PC to calculate XOR between a and b, I got a different value than c above.
In both of these cases, when I XOR the result back with b, I can get back a.
Any idea?
Because "^" is a PBP command for a BITWISE (bit-by-bit) exclusive or. The PC is using a LOGICAL exclusive or. To get the same result as the PC, use the "^^" or XOR PBP commands.