Farley, Peter x23353 wrote:
I did not see anything about it in the updates page in the language
reference nor the programmer's guide, but I'm wondering if anyone here
knows if the newest release of the Enterprise COBOL compiler will
generate "grande" arithmetic instructions for COBOL binary fields (e.g.
will it generate an AG or AGR instruction for adding two PIC S9(18)
BINARY fields?).

1. Latest and greatest is actually Enterprise COBOL 4.2

2. Ran an experiment for you; here is the generated code
   for  'add fld-d to fld-e' where both are pic s9(18) binary:

         LM    2,3,56(8)               FLD-E
         D     2,0(0,12)               SYSLIT AT +0
         CVD   3,392(0,13)             TS2=16
         MVO   376(6,13),395(5,13)     TS2=0
         CVD   2,392(0,13)             TS2=16
         TM    381(13),X'10'           TS2=5
         MVC   381(5,13),395(13)       TS2=5
         BC    8,412(0,11)             GN=31(0009E4)
         OI    385(13),X'01'           TS2=9
GN=31    EQU   *
         LM    2,3,48(8)               FLD-D
         D     2,0(0,12)               SYSLIT AT +0
         CVD   3,408(0,13)             TS2=32
         MVO   392(6,13),411(5,13)     TS2=16
         CVD   2,408(0,13)             TS2=32
         TM    397(13),X'10'           TS2=21
         MVC   397(5,13),411(13)       TS2=21
         BC    8,452(0,11)             GN=32(000A0C)
         OI    401(13),X'01'           TS2=25
GN=32    EQU   *
         AP    376(10,13),392(10,13)   TS2=0
         NI    376(13),X'0F'           TS2=0
         MVC   408(3,13),38(12)        TS2=32
         MVC   411(5,13),381(13)       TS2=35
         CVB   2,408(0,13)             TS2=32
         MVO   411(5,13),376(5,13)     TS2=35
         CVB   5,408(0,13)             TS2=32
         M     4,0(0,12)               SYSLIT AT +0
         ALR   5,2
         BC    12,502(0,11)            GN=33(000A3E)
         A     4,4(0,12)               SYSLIT AT +4
GN=33    EQU   *
         LTR   2,2
         BC    11,512(0,11)            GN=34(000A48)
         S     4,4(0,12)               SYSLIT AT +4
GN=34    EQU   *
         STM   4,5,56(8)               FLD-E


Looks like they convert to decimal and AP! This had
NUMPROC(NOPFD), TRUNC(STD), and ARITH(EXTEND) for
the compile options.

Ran again with NUMPROC(PFD), TRUNC(BIN), and ARITH(EXTEND)
and got:

         LM    2,3,48(8)               FLD-D
         SLDA  2,0(0)
         BC    11,394(0,11)            GN=31(0009EA)
         LCR   2,2
         LCR   3,3
         BC    8,394(0,11)             GN=31(0009EA)
         BCTR  2,0
GN=31    EQU   *
         ZAP   344(16,13),1367(1,10)   TS2=0
         LTR   2,2
         BC    2,420(0,11)             GN=32(000A04)
         BC    8,436(0,11)             GN=33(000A14)
         AP    344(16,13),1354(6,10)   TS2=0
         X     2,1336(0,10)            PGMLIT AT +1324
GN=32    EQU   *
         CVD   2,360(0,13)             TS2=16
         AP    344(16,13),360(8,13)    TS2=0
         MP    344(16,13),1348(6,10)   TS2=0
GN=33    EQU   *
         LTR   3,3
         BC    2,456(0,11)             GN=34(000A28)
         BC    8,466(0,11)             GN=35(000A32)
         AP    344(16,13),1354(6,10)   TS2=0
         X     3,1336(0,10)            PGMLIT AT +1324
GN=34    EQU   *
         CVD   3,360(0,13)             TS2=16
         AP    344(16,13),360(8,13)    TS2=0
GN=35    EQU   *
         TM    48(8),X'80'             FLD-D
         BC    8,478(0,11)             GN=36(000A3E)
         OI    359(13),X'01'           TS2=15
GN=36    EQU   *
         LM    2,3,56(8)               FLD-E
         SLDA  2,0(0)
         BC    11,500(0,11)            GN=37(000A54)
         LCR   2,2
         LCR   3,3
         BC    8,500(0,11)             GN=37(000A54)
         BCTR  2,0
GN=37    EQU   *
         ZAP   360(16,13),1367(1,10)   TS2=16
         LTR   2,2
         BC    2,526(0,11)             GN=38(000A6E)
         BC    8,542(0,11)             GN=39(000A7E)
         AP    360(16,13),1354(6,10)   TS2=16
         X     2,1336(0,10)            PGMLIT AT +1324
GN=38    EQU   *
         CVD   2,376(0,13)             TS2=32
         AP    360(16,13),376(8,13)    TS2=16
         MP    360(16,13),1348(6,10)   TS2=16
GN=39    EQU   *
         LTR   3,3
         BC    2,562(0,11)             GN=40(000A92)
         BC    8,572(0,11)             GN=41(000A9C)
         AP    360(16,13),1354(6,10)   TS2=16
         X     3,1336(0,10)            PGMLIT AT +1324
GN=40    EQU   *
         CVD   3,376(0,13)             TS2=32
         AP    360(16,13),376(8,13)    TS2=16
GN=41    EQU   *
         TM    56(8),X'80'             FLD-E
         BC    8,584(0,11)             GN=42(000AA8)
         OI    375(13),X'01'           TS2=31
GN=42    EQU   *
         AP    365(11,13),350(10,13)   TS2=21
         MVC   376(16,13),360(13)      TS2=32
         L     2,92(0,9)               TGTFIXD+92
         L     15,60(0,2)              V(IGZCIDB )
         LA    1,1802(0,10)            PGMLIT AT +1790
         BASR  14,15
         MVC   56(8,8),392(13)         FLD-E


Hmmm. Still seem to be doing the work in packed decimal.
Maybe there's some other setting to use, but, that's
what I found.





TIA for any info you can provide.

Peter



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

  z/OS Application development made easier
    * Our classes include
       + How things work
       + Programming examples with realistic applications
       + Starter / skeleton code
       + Complete working programs
       + Useful utilities and subroutines
       + Tips and techniques

==> Ask about being added to our opt-in list:              <==
==>   * Early announcement of new courses                  <==
==>   * Early announcement of new techincal papers         <==
==>   * Early announcement of new promotions               <==

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to