CMC

Complement Carry Flag

Opcodes

Hex Mnemonic Encoding Long Mode Legacy Mode Description
F5 CMC A Valid Valid Complement CF flag.

Instruction Operand Encoding

Op/En Operand 0 Operand 1 Operand 2 Operand 3
A NA NA NA NA

Description

Complements the CF flag in the EFLAGS register. CMC operation is the same in non-64-bit modes and 64-bit mode.

Pseudo Code

EFLAGS.CF[bit 0] = NOT EFLAGS.CF[bit 0];

Flags Affected

The CF flag contains the complement of its original value. The OF, ZF, SF, AF, and PF flags are unaffected.

Exceptions

64-Bit Mode Exceptions

Exception Description
#UD If the LOCK prefix is used.

Compatibility Mode Exceptions

Exception Description
#UD If the LOCK prefix is used.

Virtual-8086 Mode Exceptions

Exception Description
#UD If the LOCK prefix is used.

Real-Address Mode Exceptions

Exception Description
#UD If the LOCK prefix is used.

Protected Mode Exceptions

Exception Description
#UD If the LOCK prefix is used.