> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Tom Ross
> Sent: Tuesday, April 08, 2008 12:50 PM
> To: [email protected]
> Subject: (fwd) Re: Is IT becoming extinct?
> 
> 
> >(I believe this was a major factor in the demise of COBOL;
> 
> I just cannot resist responding to this (sorry I am so late, 
> I was out of the
> office for 2 weeks).
> 
> I work on the IBM COBOL compiler, and if you could see the 
> amount of interest,
> the number of compiler licenses, the sheer number of COBOL 
> programmers on IBM
> Mainframes doing new work everyday in COBOL, you would never 
> say such a thing.
> 
> For example, we are being overwhelmed with requests to 
> continue our improvements
> for XML support in COBOL, it has been the most quickly 
> adopted new feature of COBOL
> in my quarter century as an IBM COBOL compiler developer.
> 
> COBOL is more alive today than it was 10 years ago!  Demise indeed...
> 
> Cheers,
> TomR              >> COBOL is the Language of the Future! <<

Tom,

I gotta ask this, hope you don't mind. Why is the code generation for
fullword binary so weird? I have:

77 MYDATA PIC S9(8) BINARY.
..
ADD +1 TO MYDATA

The code generated is terrible (to me):

          L     6,0(0,2)                MYDATA
          SRDA  6,32(0)
          LH    0,22(0,10)              PGMLIT AT +10
          SRDA  0,32(0)
          AR    6,0
          ALR   7,1
          BC    12,164(0,11)            GN=17(0002D8)
          A     6,0(0,12)               SYSLIT AT +0
 GN=17    EQU   *
          ST    7,0(0,2)                MYDATA

Why is COBOL doing 64 bit arithmetic? Why the BC around the A when the
contents of register 6 are ignored?

This is with TRUNC(BIN). With TRUNC(STD), I get:

     LH    7,22(0,10)              PGMLIT AT +10 (halfword H'1')
     A     7,0(0,2)                MYDATA
     LR    6,7
     SRDA  6,32(0)
     D     6,4(0,12)               SYSLIT AT +4
     ST    6,0(0,2)                MYDATA

which is much better, but still confusing. In my own code, a simple:

        L       6,MYDATA
        A       6,PLUS1
        ST      6,MYDATA

suffices. Or, going with what would be more similar to COBOL's code:

        LH      7,=H'+1'
        A       7,MYDATA
        ST      7,MYDATA

what is with the SRDA and D? I cannot determine what SYSLIT+4 is because
it looks like x'05F5E100' which makes NO sense to me.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

----------------------------------------------------------------------
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