Questions tagged [cpu-flag-bits]

Condition flags describing the state of the CPU or the result of an operation it performed.

Filter by
Sorted by
Tagged with
2 votes
1 answer
178 views

Why 8086/8088 has OF in a high Flags byte?

In 8086, OF is put not into low Flags byte as other flags but separated in the second (high) byte. This is followed then in all the x86 line. Beside the possible historical reasons, this looks highly ...
user avatar
  • 430
7 votes
1 answer
296 views

What CPU architecture was first to implement 'inverted borrow' carry flag during subtractions?

Background In two's complement arithmetics, if one wants to calculate a subtraction having only an adder that calculates {cout,result}=full_adder(arg1,arg2,cin), where cin and cout are incoming and ...
user avatar
  • 9,191
2 votes
1 answer
384 views

Does the 6502's TXS and TSX affect flags or not?

Title says it all really. Some documentation claims that the S and Z flags are affected by both TXS and TSX, just as with all other transfer commands. Other documentation suggests that neither TXS nor ...
user avatar
  • 34.3k
11 votes
3 answers
2k views

Behavior of the zero and negative/sign flags on classic instruction sets

It seems to me that there's effectively two ways that the zero bit could work. Z is set iff the result of a computation is mathematically equal to 0. Z is set iff a bit pattern consisting entirely of ...
user avatar
  • 598
18 votes
5 answers
4k views

Why does the Z80 have a half-carry bit?

The Z80 apparently had a 4-bit ALU, and computes 8-bit values in two stages. The half-carry bit preserves the carry from bits 3 to 4. Why did the designers of this chip choose to preserve that value ...
user avatar
  • 34.3k