The CMC instruction

Inverting the carry flag CF.

The CMC instruction format

InstructionDescription
CMCComplement the carry flag (CF = NOT CF).

Inverts the current value of the carry flag CF. If CF is 0, it becomes 1; if it is 1, it becomes 0.

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
        stc                ; CF = 1
        cmc                ; CF = 0
        cmc                ; CF = 1

        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
Yes
PF
No
AF
No
ZF
No
SF
No
TF
No
IF
No
DF
No
OF
No