# `cmc`

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

Web page: https://asm-editor.specy.app/documentation/x86/instruction/cmc

**Complement carry flag**

Category: System

Complements the carry flag, setting it to 1 if it was 0 and to 0 if it was 1.

8086 and later

[Intel's reference: CMC](https://intel.github.io/SDM/instruction/CMC.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | depends on the result |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

Reads: CF

## Forms

- `cmc`

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        cmc

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
