ANDN
Instruction: Bitwise AND a value with the NOT of another.
ANDN Value1, < # > Value2
Result: Value1 AND !Value2 is stored in Value1.
- Value1 (d-field) is the register containing the value to bitwise AND with !Value2 and is the destination in which to write the result.
- Value2 (s-field) is a register or a 9-bit literal whose value is inverted (bitwise NOT) and bitwise ANDed with Value1.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– | Z Result | C Result | Result | Clocks |
011001 001i 1111 ddddddddd sssssssss | Result = 0 | Parity of Result | Written | 4 |
Concise Truth Table:
In | Out | ||||||
Destination | Source | Z | C | Effects | Destination | Z | C |
$F731_125A; -147,778,982 | $FFFF_FFFA; -6 | - | - | wz wc | $0000_0000; 0 | 1 | 0 |
$F731_125A; -147,778,982 | $FFFF_FFF8; -8 | - | - | wz wc | $0000_0002; 2 | 0 | 1 |
$F731_125A; -147,778,982 | $FFFF_FFF0; -16 | - | - | wz wc | $0000_000A; 10 | 0 | 0 |
Explanation
ANDN (bitwise AND NOT) performs a bitwise AND of the inverted value (bitwise NOT) of Value2 into that of Value1.
If the WZ effect is specified, the Z flag is set (1) if Value1 AND !Value2 equals zero. If the WC effect is specified, the C flag is set (1) if the result contains an odd number of high (1) bits. The result is written to Value1 unless the NR effect is specified.
Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.