NOT takes one operand, a byte or word register or memory location, and inverts every bit in place: each 0 becomes 1 and each 1 becomes 0. This is called the one's complement.
1011 0010 AL = B2hNOT= 0100 1101 AL = 4Dh
For a memory operand the assembler needs the size: NOT BYTE PTR [BX] or NOT WORD PTR [SI]. An immediate cannot be inverted at run time; if you need the complement of a constant, write it in the source with the assembler's own NOT operator or just the inverted number.
Flags
NOT changes no flags at all, which is unusual for a logic instruction. If you want to branch on the result, follow it with TEST AL, AL, or use XOR AL, 0FFh, which produces the same bits and does set SF, ZF and PF.
NOT and NEG
In two's complement, NOT x equals -x - 1. NEG gives -x, so NEG is the same as NOT followed by adding 1. For example NOT turns 5 (05h) into FAh, which is -6 as a signed byte, while NEG turns it into FBh, which is -5.
Idioms
The common use is clearing bits whose mask is only known at run time. Build the mask, invert it, then AND: the bits that were 1 in the mask become 0 in the value, and everything else is kept.
MOV AL, 0B2h ; 1011 0010CALL SHOWBINNOT ALCALL SHOWBIN ; 0100 1101MOV BL, 0Ch ; mask: bits 2 and 3NOT BL ; 1111 0011AND AL, BL ; clear bits 2 and 3CALL SHOWBIN ; 0100 0001SHOWBIN PROC NEAR ; print AL as 8 binary digits and a spacePUSHF ; keep the caller's flagsPUSH AXPUSH BXPUSH CXPUSH DXMOV BL, ALMOV CX, 8NEXTBIT:SHL BL, 1 ; the top bit falls into CFMOV DL, "0"ADC DL, 0 ; "0" + CF = "0" or "1"MOV AH, 02hINT 21hLOOP NEXTBITMOV DL, " "MOV AH, 02hINT 21hPOP DXPOP CXPOP BXPOP AXPOPFRETSHOWBIN ENDP