Skip to main content

NEGATE

Multiply the operand by -1.

OpcodeBytesCyclesFormExample
$3723negate b:_negate b:1
$3823negate p:_negate p:2
$3923negate i:_negate i:4
Condition flagOutput
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.