The CMC instruction
Inverting the carry flag CF.
The CMC instruction format
| Instruction | Description |
|---|---|
| CMC | Complement 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 .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
YesPF
NoAF
NoZF
NoSF
NoTF
NoIF
NoDF
NoOF
No