A <- A & r
AND
r
| b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | r | ||
A logical AND operation is performed between the contents of register r and the contents of the Accumulator. The result is stored in the Accumulator. The r symbol identifies the registers A, B, C, D, E, H, or L, assembled as follows in the object code:
| Register | r | Hex |
|---|---|---|
| A | 111 | $A7 |
| B | 000 | $A0 |
| C | 001 | $A1 |
| D | 010 | $A2 |
| E | 011 | $A3 |
| H | 100 | $A4 |
| L | 101 | $A5 |
| S | is set if result is negative, otherwise it is reset. |
| Z | is set if result is 0, otherwise it is reset. |
| H | is set. |
| P/V | is reset if overflow, otherwise it is reset |
| N | is reset. |
| C | is reset. |
If REgister B contains $7B (0111 1011) and the Accumulator contains $C3 (1100 0011), then upon the execution of
AND B
the Accumulator contains $43 (0100 0011).