AND
Compute the bitwise AND of the two operands, storing the result in the left operand.
| Opcode | Bytes | Cycles | Form | Example |
|---|---|---|---|---|
| $76 | 3 | 3 | AND B:_, {U_BYTE} | AND B:1, 123 |
| $CE | 4 | 3 | AND P:_, {U_PAIR} | AND P:2, 12345 |
| $77 | 3 | 3 | AND I:_, {U_BYTE} | AND I:4, 123 |
| $CF | 4 | 3 | AND I:_, {U_PAIR} | AND I:4, 12345 |
| $78 | 3 | 3 | AND I:_, XHEX {XINT} | AND I:4, XHEX $D000_0000 |
| $79 | 3 | 3 | AND B:_, B:_ | AND B:1, B:2 |
| $7A | 3 | 3 | AND P:_, P:_ | AND P:2, P:4 |
| $7B | 3 | 3 | AND I:_, I:_ | AND I:4, I:8 |
| Condition flag | Output |
|---|---|
| zero (ZF) | If the result is zero, this flag is 1; otherwise it is 0. |
| negative (NF) | This flag is updated with the highest bit of the result. For example, if AND B:0, $F0 stores $80 in B:0, then NF will be 1. |
| overflow (OF) | This flag is always 0. |
| carry (CF) | This flag is always 0. |