AND
Instruction: Bitwise AND two values.
AND 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 bitwise ANDed with Value1.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– | Z Result | C Result | Result | Clocks |
011000 001i 1111 ddddddddd sssssssss | Result = 0 | Parity of Result | Written | 4 |
Concise Truth Table:
In | Out | ||||||
Destination | Source | Z | C | Effects | Destination | Z | C |
$0000_000A; 10 | $0000_0005; 5 | - | - | wz wc | $0000_0000; 0 | 1 | 0 |
$0000_000A; 10 | $0000_0007; 7 | - | - | wz wc | $0000_0002; 2 | 0 | 1 |
$0000_000A; 10 | $0000_000F; 15 | - | - | wz wc | $0000_000A; 10 | 0 | 0 |
Explanation
AND (bitwise AND) performs a bitwise AND of the value in 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.