dmsc wrote:
It is simply a convention, the CPU designer can choose if "Carry = Borrow" or if "Carry = 1 - Borrow".
The 6502, PIC, ARM and PowerPC are examples of CPU where Carry is the inverted Borrow. The Z80 and x86 are examples of CPU where Carry is used as Borrow. And there is MIPS, that does not have flags at all.
So, I would say that nowadays, most used CPUs use the 6502 convention.
Sorry, I missed the ARM and I didn't know that the PIC and PowerPC also inverts the carry. Thank you. I can only add that Moto's (680x, 68k) and DEC's (PDP-11, VAX) processors also use not inverted carry. I didn't know about the carry on the DEC Alpha. The IBM System/360 doesn't invert carry. The Microblaze architecture inverts carry but it can't directly check it that makes work a bit easier.
The inverted carry helps to make division faster. I used it in my division routines for the 6502 and ARM in my
pi-spigot project. I dare to think that my divisions are among the fastest known. IMHO it is good to have the inverted carry on a processor without hardware division.
It is interesting, did somebody of the 6502 team know about advantages of the inverted carry? It seems that the 6502 was the first processor with the inverted carry.