Re: Cobol compiler date

"Kevin Leonard" <kl_j76-/[email protected]>
Newsgroups gmane.comp.emulators.turnkey-mvs
Message-ID <[email protected]>

> Actually, it probably would be a Character 19 C'19' for a
> simple move, and not a zone decimal equivalent.

It's a hard-coded character constant:

DATE1    DC    CL15'JAN  5,1966'

OS compilers weren't reentrant, so there is no move of
a constant C'19' to a work area.  Instead, the date is
built on top of the constant, and the whole modified field
is moved to the page header and the DATE-COMPILED paragraph.

> Next most likely would be a packed 1900 x'01900F', not a
> packed 19 x'019F' due to decimal alignment, but most
> manipulations would occur after converting to Character..
>
> Least likely would be a Binary 1900 or x'076C', and not Binary 
> 19 or x'0013', due to decimal alignment, but most manipulations
> would occur after converting to Character.

The date routine is fast but really inelegant code.  It
does a leap year check with TMs against the digit part
of the zoned decimal characters, pretending they're binary:

         TM    DATE1+10,X'01'
       BO    NOLEAP
         TM    DATE1+9,X'01'
       BO    DATDECOD    DECADE ODD
         TM    DATE1+10,X'02'
       BO    NOLEAP
       B     LEAP
DATDECOD TM    DATE1+10,X'02'
       BZ    NOLEAP
LEAP   LA    R4,156
       STC   R4,TABLE+9
NOLEAP SLL   R1,4
       LA    R1,12(1)
       STH   R1,INDATE

-- 
Kevin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.