11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler4.11. Xor ‘^’The Xor operator (^) returns the bitwise XOR of two values. Each bit of the values issubject to the following logic: -0 XOR 0 = 00 XOR 1 = 11 XOR 0 = 11 XOR 1 = 0The result returned by ^ will contain 1s in any bit positions in which one or the other (butnot both) input values contain 1s: -DIM Value1 as BYTEDIM Value2 as BYTEDIM Result as BYTEValue1 = %00001111Value2 = %10101001Result = Value1 ^ Value2PRINT bin Result ' Display XOR result (%10100110)-- or --PRINT bin ( %00001111 ^ %10101001 ) ' Display XOR result (%10100110)19Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!