Bitwise Operators: Difference between revisions
m
→XOR: fixed formatting inconsistency
Puppydrum64 (talk | contribs) m (→XOR) |
Puppydrum64 (talk | contribs) m (→XOR: fixed formatting inconsistency) |
||
(One intermediate revision by the same user not shown) | |||
Line 106:
* A bitwise <code>NOT</code> is the same as <code>XOR -1</code>.
* <code>A ^ A = 0</code>. Furthermore, if <code>A ^ B = 0</code>, then <code>A = B</code>.
* If <code>((A ^ B) & C) = 0</code>, then A and B both share the bits of C in common.
Line 112:
===Toggling===
A flag register <code>XOR</code>'d with a given value will flip those particular bits, and leave the rest alone.
==Citations==▼
#[[http://www.6502.org/tutorials/compare_beyond.html Beyond 8-Bit Unsigned Comparisons by Bruce Clark]]▼
==NOT==
Line 121 ⟶ 117:
Among <code>AND</code>, <code>OR</code>, <code>XOR</code>, and <code>NOT</code>, only <code>XOR</code> and <code>NOT</code> are reversible.
▲==Citations==
▲#[[http://www.6502.org/tutorials/compare_beyond.html Beyond 8-Bit Unsigned Comparisons by Bruce Clark]]
|