neg

Negate

Negates A, giving its two's complement, which is the same as subtracting A from zero.

2 bytes · 8 cycles

SZHP/VNC ●●●●1●
  • ● set from the result
  • 1 always 1

Forms

  • neg

    The contents of A are negated (two's complement). Operation is the same as subtracting A from zero.

        .org 0x8000
        ld a, 5
        neg
        halt