# `not`

[M68K Documentation](https://asm-editor.specy.app/documentation/m68k.md) › [Instructions](https://asm-editor.specy.app/documentation/m68k/instruction.md)

Web page: https://asm-editor.specy.app/documentation/m68k/instruction/not

**Logical complement**

Category: Logic

Inverts every bit of the operand at the given size.

Sizes .b .w .l, .w by default

Used in: [Arithmetic, logic and bits](https://asm-editor.specy.app/learn/courses/m68k/think-in-assembly/arithmetic-logic-and-bits.md) (M68K assembly), [Arithmetic, logic and bits](https://asm-editor.specy.app/learn/courses/assembly-basics/think-in-assembly/arithmetic-logic-and-bits.md) (Assembly basics)

## Flags

| Flag | Effect |
| --- | --- |
| X | not changed |
| N | depends on the result |
| Z | depends on the result |
| V | always 0 |
| C | always 0 |

## Forms

- `not <ea>`
  - Operand: Dn, (An), (An)+, -(An), d(An), d(An,Xn), abs (data alterable)

## Operands

- [`<ea>`](https://asm-editor.specy.app/documentation/m68k/addressing-mode.md): An operand using one of the addressing modes listed for this form. The list determines whether it can be a register, memory or an immediate value. With `opt p=68020`, an allowed `d(An,Xn)` or `d(PC,Xn)` mode also permits the corresponding 68020 indexed and memory indirect forms. See [68020 addressing](https://asm-editor.specy.app/documentation/m68k/addressing-mode/68020.md).

## Example

```m68k
* --- Bitwise complement ---
move.l #%00001111, d0
not.b d0 ; d0 low byte = %11110000

* --- Size affects which bits are flipped ---
move.l #$0000FFFF, d1
not.w d1 ; low word flipped: d1 = $00000000

move.l #$0000FFFF, d2
not.l d2 ; all bits flipped: d2 = $FFFF0000
```
