CALDAYNO                                                         21-AUG-1978 23:24:20   VAX-11 MACRO X0.3-11               Page   1

A0001                                                                                                                            (1)



                                     0000     1 	.TITLE	CALDAYNO

                                     0000     2 	.IDENT	"A0001"

                                     0000     3 

                                     0000     4 ;

                                     0000     5 ; COPYRIGHT (C) 1977

                                     0000     6 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000     7 ;

                                     0000     8 ; THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

                                     0000     9 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000    10 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000    11 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000    12 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000    13 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000    14 ; REMAIN IN DEC.

                                     0000    15 ;

                                     0000    16 ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

                                     0000    17 ; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

                                     0000    18 ; CORPORATION.

                                     0000    19 ;

                                     0000    20 ; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

                                     0000    21 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000    22 

                                     0000    23 ;++

                                     0000    24 ;

                                     0000    25 ; FACILITY:	MAGNETIC TAPE ACP  

                                     0000    26 ;

                                     0000    27 ; ABSTRACT:

                                     0000    28 ;	THIS MODULE CALCULATES THE DAY NUMBER SINCE THE START DATE

                                     0000    29 ;

                                     0000    30 ; ENVIRONMENT:

                                     0000    31 ;	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES AND

                                     0000    32 ;	INTERNAL EXEC ROUTINES.

                                     0000    33 

                                     0000    34 ;

                                     0000    35 ; AUTHOR:  DEBORAH H. GILLESPIE,   CREATION DATE:  23-JUN-77  

                                     0000    36 ;

                                     0000    37 ; MODIFIED BY:

                                     0000    38 ;

                                     0000    39 ;  , VERSION  ,

                                     0000    40 ; 01	- 

                                     0000    41 ;--

                                     0000    42 

                                     0000    43 ;

                                     0000    44 ; INCLUDE FILES:

                                     0000    45 ;

                                     0000    46 

                                     0000    47 ;

                                     0000    48 ; MACROS:

                                     0000    49 ;

                                     0000    50 

                                     0000    51 ;

                                     0000    52 ; EQUATED SYMBOLS:

                                     0000    53 ;

                           00000004  0000    54 D1	=	4	;FIRST DATE ADDRESS

                           00000008  0000    55 D2	=	8	;SECOND DATE ADDRESS

                                     0000    56 

                                     0000    57 ;

CALDAYNO                                                         21-AUG-1978 23:24:20   VAX-11 MACRO X0.3-11               Page   2

A0001                                                                                                                            (1)



                                     0000    58 ; OWN STORAGE:

                                     0000    59 ;

CALDAYNO                                                         21-AUG-1978 23:24:20   VAX-11 MACRO X0.3-11               Page   3

A0001                                                                                                                            (2)



                                     0000    61 ;++

                                     0000    62 

                                     0000    63 ; FUNCTIONAL DESCRIPTION:

                                     0000    64 ;	THIS ROUTINE CALCULATES THE BINARY DAY NUMBER SINCE START DATE

                                     0000    65 ;

                                     0000    66 ; CALLING SEQUENCE:

                                     0000    67 ;	CALDAYNO(ARG1,ARG2)

                                     0000    68 ;

                                     0000    69 ; INPUT PARAMETERS:

                                     0000    70 ;	ARG1 - ADDRESS OF FIRST 64 BIT DATE

                                     0000    71 ;	ARG2 - ADDRESS OF SECOND 64 BIT DATE

                                     0000    72 ;

                                     0000    73 ; IMPLICIT INPUTS:

                                     0000    74 ;	NONE

                                     0000    75 ;

                                     0000    76 ; OUTPUT PARAMETERS:

                                     0000    77 ;	ARG1 - ADDRESS OF FIRST DATE WHICH RECEIVES BINARY DAY NUMBER

                                     0000    78 ;	ARG2 - ADDRESS OF SECOND DATE WHICH RECEIVES BINARY DAY NUMBER

                                     0000    79 ;

                                     0000    80 ; IMPLICIT OUTPUTS:

                                     0000    81 ;	NONE

                                     0000    82 ;

                                     0000    83 ; ROUTINE VALUE:

                                     0000    84 ;	NONE

                                     0000    85 ;

                                     0000    86 ; SIDE EFFECTS:

                                     0000    87 ;	NONE

                                     0000    88 ;

                                     0000    89 ;--

                                     0000    90 

                                 00000000    91 	.PSECT	$CODE$,NOWRT,LONG

                                     0000    92 

                                     0000    93 

                                     0000    94 CALDAYNO::			;CALCULATE BINARY DAY NUMBER

                               0004  0000    95 	.WORD	^M<R2>		;SAVE REGISTERS

            50         04 AC     D0  0002    96 	MOVL 	D1(AP),R0	;GET ADDRESS OF FIRST 64 BIT DATE

                          07     10  0006    97 	BSBB	CALDAY		;NEGATE IT

            50         08 AC     D0  0008    98 	MOVL 	D2(AP),R0	;GET ADDRESS OF SECOND 64 BIT DATE

                          01     10  000C    99 	BSBB	CALDAY		;NEGATE IT

                                 04  000E   100 	RET			;RETURN TO CALLER

CALDAYNO                                                         21-AUG-1978 23:24:20   VAX-11 MACRO X0.3-11               Page   4

A0001                                                                                                                            (3)



                                     000F   102 ;++

                                     000F   103 ;

                                     000F   104 ; FUNCTIONAL DESCRIPTION:

                                     000F   105 ;	THIS ROUTINE CALCULATES THE BINARY DAY NUMBER

                                     000F   106 ;

                                     000F   107 ; CALLING SEQUENCE:

                                     000F   108 ;	BSBB	CALDAY

                                     000F   109 ;

                                     000F   110 ; INPUT PARAMETERS:

                                     000F   111 ;	R0 - ADDRESS OF64 BIT DATE;

                                     000F   112 ; IMPLICIT INPUTS:

                                     000F   113 ;	NONE

                                     000F   114 ;

                                     000F   115 ; OUTPUT PARAMETERS:

                                     000F   116 ;	QUADWORD RECEIVESBINARY DAY NUMBER

                                     000F   117 ;

                                     000F   118 ; IMPLICIT OUTPUTS:

                                     000F   119 ;	NONE

                                     000F   120 ;

                                     000F   121 ; ROUTINE VALUE:

                                     000F   122 ;	NONE

                                     000F   123 ;

                                     000F   124 ; SIDE EFFECTS:

                                     000F   125 ;	NONE

                                     000F   126 ;

                                     000F   127 ;--

                                     000F   128 

                                     000F   129 CALDAY:			;CALCULATE BINARY DAY NUMBER FOR ONE 64 BIT DATE

            51            60     7D  000F   130 	MOVQ	(R0),R1		;GET QUADWORD

                                     0012   131 

                                     0012   132 ; 864000000000 IS THE NUMBER OF TENTHS OF A MICROSECOND IN A DAY

                                     0012   133 ; DIVIDE BY 1024 AND THEN 843750000 

            20            0A     EF  0012   134 	EXTZV	#10,#32,R1,R1	;DIVIDE BY 1024

            51            51         0015       

            16            0A     EF  0017   135 	EXTZV	#10,#22,R2,R2

            52            52         001A       

            51   324A9A70 8F     7B  001C   136 	EDIV	#843750000,R1,R1,R2	

            52            51         0023       

            60            51     7D  0025   137 	MOVQ	R1,(R0)		;STORE QUADWORD

                                 05  0028   138 	RSB			;RETURN

                                     0029   139 

                                     0029   140 	.END

CALDAYNO                                                         21-AUG-1978 23:24:20   VAX-11 MACRO X0.3-11               Page   5

SYMBOL TABLE                                                                                                                     (3)



AQB_TYPE       = 00000005            

CALDAY           0000000F R     02   

CALDAYNO         00000000 RG    02   

D1             = 00000004            

D2             = 00000008            

FCB_TYPE       = 00000000            

MVL_TYPE       = 00000004            

RVT_TYPE       = 00000003            

VCB_TYPE       = 00000002            

WCB_TYPE       = 00000001            





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$CODE$           00000029      02     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

26920. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:CALDAYNO,LIS$:CALDAYNO/-SP=EXECML$/ML,SRC$:MTADEF,CALDAYNO

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 2 INTER. FILE WRITES. 

