CF--The
"carry flag". Contains the bit that carries out of an addition or
subtraction.
Can be used by the "jc" (jump if carry flag is set) instruction.
Set by all the arithmetic instructions.
Can be added into another arithmetic operation with "adc" (add with
carry). For example, you can preserve the bit overflowing out of
an add using a subsequent adc. For example, here we do a tiny
16-bit add between cx and si, that overflows. We can catch the
overflow bit and fold it into the next higher add:
mov cx,0xf00d ; low 16 bits A
mov si,0x1111 ; low 16 bits of B
mov ax,0x00; high 16 bits of A
mov dx,0x00; high 16 bits of B
add cx,si ; A+=B (low 16 bits)
adc ax,dx ; A+=B (high 16 bits)
ret
(Try this in NetRun now!)