0

I can't find a reasonable formula for this. I know CF is used for unsigned arithmetic and OF for signed.

Please give some example arithmetic operations (like 5-7,7-5 etc.) along with the heuristic.

Bruce
  • 33,927
  • 76
  • 174
  • 262

1 Answers1

2

The answer to this question contains C code to emulate the ADD, ADC, SUB and SBB instructions with the carry and overflow flags and a test.

Another possibly interesting related question is here.

And you should be able to find this info in the official CPU documentation from Intel and AMD.

Community
  • 1
  • 1
Alexey Frunze
  • 61,140
  • 12
  • 83
  • 180