NEGATE
Multiply the operand by -1.
| Opcode | Bytes | Cycles | Form | Example |
|---|---|---|---|---|
| $37 | 2 | 3 | NEGATE B:_ | NEGATE B:1 |
| $38 | 2 | 3 | NEGATE P:_ | NEGATE P:2 |
| $39 | 2 | 3 | NEGATE I:_ | NEGATE I:4 |
| Condition flag | Output |
|---|---|
| zero (ZF) | If the value is zero, this flag is 1; otherwise it is 0. |
| negative (NF) | If the signed result is a negative number, this flag is 1; otherwise it is 0. |
| overflow (OF) | This flag is always 0. |
| carry (CF) | This flag is always 0. |
Notes
-
This operation is equivalent to subtracting the operand from 0 using SUBTRACT.
-
Replaces the value of the operand with its two's complement.