1 06/01/78 PL/I decimal data and the command hunt_dec.
 2 
 3 The command hunt_dec is a tool to aid the user when the new
 4 PL/I compiler implementing packed decimal is made available.
 5 This will be an incompatible change because the layout of
 6 variables containg both the unaligned and decimal attributes will
 7 be changed.  Therefore, it is necessary for the user to find
 8 those PL/I programs which currently use "unaligned decimal" so
 9 that the appropriate program and data base changes can be mode
10 before recompiling the program using the new compiler.
11 
12 
13 Classification algorithm:
14 The algorithm hunt_dec uses to classify PL/I object segments
15 is simple.  The text section is scanned for EIS decimal
16 arithmetic instructions generated by the PL/I compiler.  If none
17 are found the object segment is classified as "no decimal".  If
18 decimal instructions are found, they and their descriptors are
19 examined for address modification and nonzero digit offsets.  If
20 either is present, the object segment is classified as "decimal
21 unaligned", otherwise it is classified as "decimal aligned".
22 
23 
24 Validity of classification:
25 The validity of the classification algorithm rests upon
26 knowledge of how the PL/I compiler generates machine code.  Below
27 is a table listing the reliability of the algorithm for the
28 different classifications.
29 
30 
31 CLASSIFICATION                RELIABILITY
32 
33 unaligned decimal             Always correct.
34 
35 aligned decimal               Fails when an unaligned decimal
36                               variable happens to falls on a word
37                               boundary.  For example,
38                                    dcl 1 record aligned,
39                                         2 item1 fixed bin(17),
40                                         2 item2 fixed dec(3)
41                                         unaligned;   .
42                               The variable, item2, is unaligned
43                               decimal.  But, since it is located
44                               one word from the beginning of the
45                               structure the instruction accessing
46                               it appears to be accessing ALIGNED
47                               decimal data.
48 
49 no decimal                    If fixed decimal variables are
50                               present in the source program but
51                               are never referenced or do not have
52                               the initial attribute, no EIS fixed
53                               decimal instructions are generated
54                               by the compiler.
55 
56      The important point to be made is that the hunt_dec command
57 will correctly identify PL/I object segments that use unaligned
58 decimal data most of the time while letting a few segments slip
59 by misclassified as aligned decimal or no decimal.