title: Why does CMP (compare) sometimes sets a Carry Flag in 8086 assembly?
body: <p>I've been reading around and with the 8086 Instruction Set, it says that a CMP (compare) can set the Carry Flag.  I understand that a compare subtracts two operands but I was wondering if anyone can provide an example when that is the case.</p>
  
  <p>I just can't grasp the idea of adding a number and a negative number will set the carry flag.  I've read into the borrow flag but I just needed an example to clarify  my understanding of a compare instruction.</p>
  
  <p>Also, I understand that if 3 - 5 = -2 would set the negative flag... when is carry set?</p>