Flags
These live in the F register and are rewritten by arithmetic/logic/shift instructions:
| flag | mask | description | set by |
|---|---|---|---|
| Z | 0x01 | Result is zero. | ADD, SUB, AND, OR, XOR, SHL, SHR (and pseudo-instructions that expand to them) |
| N | 0x02 | Copies bit 7 (sign) of the 8-bit result. | ADD, SUB, AND, OR, XOR, SHL, SHR |
| C | 0x04 | Set when an 8-bit result wraps: carry on ADD/SHL/SHR, borrow on SUB. | ADD, SUB, SHL, SHR |
Notes:
- Instructions not listed leave flags unchanged.
- Pseudo-instructions (
INC,DEC,CMP,CMPI, shifts) inherit flag behavior from the underlying ops. - Flags 0x08, 0x10, 0x20, 0x40, 0x80 are reserved for future use.