DFSORT uses an F for a positive sign if ZDPRINT=YES is in effect or a C for a positive sign if ZDPRINT=NO is in effect.
There had been couple of more instancnes where the sign-bit has been talked about:
1. I believe it's nothing to do with DFSort in partiular but I'm not very sure.
2. Why do we have two different characters represting the positive values?
PS. Question is not properly framed, however, I hope I could convey what is confusing me.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
Why do we have two different characters represting the positive values?
Because 50 years ago the IBM "builders" decided that there would be 3 signs - 2 positive (C and F) and one negative (D). This was a carry-over from the way signs were implemented on "punched cards" (which was handled by an "overpunch").
DFSORT allows either of the positive signs to be specified as the default.
2. Why do we have two different characters represting the positive values?
I might be wrong, just answering from early computer reminiscences
why the C/D zone value were chosen for positive and negative during and after computations should be researched in the logic diagrams of early computers/and tabulating machines
why the F is accepted as a positive sign most probably because once upon a time C and D had to be overpunched on early punching machines
( early punching machined had only the numeric keyboard )
well, the IBM type 1 keypunch I saw once had only the numeric part
later machines from the 024/026/029 had the almost full keyboard
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
Strictly speaking, a X'F' (all 1's) in the sign nybble is not a positive sign; it is the lack of a sign. In pretty much every case that I can think of, it is treated as equivalent to a positive sign, but you can detect the different bit pattern and, of course, a bitwise comparison will correctly detect X'123C' as different from X'123F'.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Further, there are actually more sign possibilities.
A, B, C, D, E and F are all valid signs.
IBM splits these into two groups, "preferred signs", which are C, D, and F and "non-preferred signs" which are A, B and E.
You end up with three for positive, two for negative, and one for unsigned (which is always treated as positive when a value of that sign is used).
At the level of the OP-codes, all arithmetic operations accept any of the signs, but will only generate results with a sign of C, positive, or D negative. You (or a compiler) have to do the F bit yourself (an Immediate Or with a mask of X'0F' or X'F0' depending on whether packed or zoned is required respectively).
Thus, the non-preferred signs are accepted, but their existence can be somewhat ephemeral.
If you ever see a non-preferred sign, start worrying and check it out, as it might be messing things up (you are unlikely to see one).
Don't ever let and F get into the sign of a field which should actually be signed (should contain a C or a D) as this can also cause problems.