Assembly ADC (Add with carry) to C++

Martijn Courteaux picture Martijn Courteaux · Nov 11, 2010 · Viewed 42k times · Source

There is an x86 assembly instruction ADC. I've found this means "Add with carry". What does this mean/do? How would one implement the behavior of this instruction in C++?

INFO:
Compiled on Windows. I'm using a 32-bit Windows Installation. My processor is Core 2 Duo from Intel.

Answer

Simone picture Simone · Nov 11, 2010

ADC is the same as ADD but adds an extra 1 if processor's carry flag is set.