1

The carry flag seems to have two main uses. 1) it is useful for chaining addition/subtraction instructions to operate on numbers larger than native size. Adding 32bit ints on an 8-bit architecture for example. 2) it is used for conditional branches. There are some less common uses as well (I've used fcomi on intel for example). In particular, the carry flag is not defined or accessible from C or any other common non-assembler language. With 32 and 64bit architectures being quite common and most software written in C I have to wonder:

Is the carry flag obsolete? Who would miss it if a new architecture came along without it?

I'm assuming it would not be required as a condition code (flags replaced by predicates for example), so AFAICT only it's use for chaining add/sub/rot and the effect of shifting in/out of it would be gone.

Charles
  • 50,943
  • 13
  • 104
  • 142
phkahler
  • 5,687
  • 1
  • 23
  • 31
  • 1
    Are you confident your compiler doesn't generate code that uses the carry flag? :) – sarnold May 18 '12 at 02:26
  • @sarnold - I would guess current compilers use it for conditionals, for which I would propose a different mechanism. Other than that, I can't think of a reason for it - hence the question :-) – phkahler May 18 '12 at 19:15

0 Answers0