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. |