You can find examples where the carry and overflow flags are set to 0 and 1 after adding or subtracting integers in this answer to the corresponding question. <w> You can also find an example of C code that emulates adding with carry and subtraction using borrowing instructions for 8-bit numbers, and you can play with this, you might get more examples.
There is something like this in the output format:
127( 127) - 255( -1) - 1 = 127( 127) CY=1 OV=0
Where each number is represented as unsigned and enclosed in brackets (2 additions) next to it. The number before = is the carry flag before the ADC / SBB. CY= and OV= show carry and overflow flags after ADC / SBB.
Comparison does almost the same thing as subtraction without borrowing, except that it only affects the carry, overflow, sign and zero flags (and parity and auxiliary carry, but they are not important here) without changing the number in the register / memory.
source share