On 04/25/2013 07:19 PM, Shmuel Metz (Seymour J.) wrote:
In
<cae1xxdfoflzbbxuvaammpcn2nqn9s46bnd7to8urosko87n...@mail.gmail.com>,
on 04/25/2013
at 08:43 AM, John Gilmore <[email protected]> said:
There is in fact an advantage to using a sign value of F, 1111b,
instead of C, 1010b in some circumstances.
If so, you haven't iodentified it.
See the programming note midway in the first column of page 8-3 of
the current PrOp.
If you are referring to "The result of the PACK instruction converting
such a number to the signed-packed-decimal format may be used directly
as an operand for decimal instructions.", it applies equally well to
1100 (C) and 1110 (E). In effect, the note says that using F will do
no harm, not that it has an advantage.
An old, old historic convention with punch cards was to use an "11"
punch above the rightmost digit on a card for negative numeric fields
(which converts that column to represent EBCDIC X'D0' to X'D9) and no
zone punch if positive, so PACK applied to bytes from such a field would
get a consistent "F" sign for positive and "D" sign for negative and the
result of the pack could be directly used as a Packed Decimal arithmetic
operand. Going the other way, if you knew for certain that the packed
number was positive and the sign nibble was "F", then UnPack gives the
correct EBCDIC character for the rightmost digit without any clean up.
Unfortunately results of packed decimal arithmetic use "C" for positive
results, so if unsure how a field was produced, something like an OI of
"F0" would be required on the rightmost byte for positive values to
force a numeric character after an Unpack (or use some alternative
unpack method like the Edit instruction). A minor simplification,
granted, but being able to eliminate a few instructions is always
aesthetically pleasing.
--
Joel C. Ewing, Bentonville, AR [email protected]
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN