The NOT instruction

One's complement negation (bitwise NOT).

Format of the NOT instruction

InstructionDescription
NOT reg/mem8Inverts each bit of reg/mem8.
NOT reg/mem16Inverts each bit of reg/mem16.

Performs the bitwise NOT operation (every 1 is set to 0 and every 0 is set to 1) on the destination operand and stores the result in the location of the destination operand. The destination operand can be a register or a memory location.

This instruction can be used with the lock prefix to allow the instruction to be executed atomically.

Usage example

title Author: Evgeny Sergeevich Dovgopolov

.model small
.stack 100h

code segment public        ; Start of the code segment
    assume cs:code

    main proc              ; Start of the main procedure
        mov     al, -4     ; Copy the value -4 into the al register
        not     al         ; Perform negation of the value in the al register

        mov     ax, 4C00h  ; Copy the process termination function number into ah and the value into al
        int     21h        ; Call the interrupt
    main endp              ; End of the main procedure

code ends                  ; End of the code segment
end main                   ; End of file. The main procedure is the entry point

Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".

Processor status flags

CF
No
PF
No
AF
No
ZF
No
SF
No
TF
No
IF
No
DF
No
OF
No