A shorter approach would be to use the actual 1970-01-01 00:00:00 epoch date in 
STCKE format:

X'007D91048BCA0000'

Subtract that value from the first 64 bits of STCKE and then divide by 
F'1600000' to get seconds since the Unix epoch.

Of note, a recent Metal C compile of that algorithm with ARCH(10) TUNE(10) 
generates an add of the negative of the Unix epoch value to the STCKE value and 
then divides by =F'1600000' (DSGF) to get the seconds value.

HTH

Peter

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of [email protected]
Sent: Tuesday, April 11, 2017 7:19 AM
To: [email protected]
Subject: Rif: Re: Rif: Re: CONVTOD Help

the value:
X1972    DC       XL8'0008126D60E46000'
taken from POP  v2.2 pdf pag 7-315 (shifted right 12 bits)

A1970    DC       FL8'6307200' 2*365*24*60*60 number of seconds between
1970-01-01-00: 00: 00 and 1972-01-01-00: 00: 00



the routine is reentrant, works without a base register and has no local
areas.
new version without errors, fewer instructions and correct signs.


D1970    RSECT
D1970    AMODE    31
D1970    RMODE    ANY
         BAKR    14,0
         ICM      4,15,0(1)     . TS  ADDR
         LA       4,0(4)        . STRIP HOB
         LARL     3,MILIONE
         USING    MILIONE,3
         STCK     0(4)          . STORE NEW CLOCK
         LG       7,0(4)        . IN R6
         SRLG     7,7,12
         LG       8,X1972
         SGR      7,8
         LG       8,MILIONE
         XR       6,6
         DSGR     6,8
         STG      7,0(4)   R6 REMAINDER R7 QUOTIENT
         LG       8,A1970
         AGR      7,8
         STG      7,8(4)
         XR       15,15
         PR
         DS       0F
MILIONE  DC       FL8'1000000'
A1970    DC       FL8'6307200'   2*365*24*60*60
X1972    DC       XL8'0008126D60E46000' FROM P.O.P SHIFT R 12
         END  
--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

Reply via email to