.TITLE GTDATI .IDENT /V01/ .ENABLE LC .MCALL GTIM$S ; ; This module forms part of the suite of Date Routines returning the ; current date in one of the following forms, or converting one form to ; another. ; Form I - Day, Month & Year since 1950 as 3 byte values ; Form A - ASCII DD-MMM-YY ; Form D - Integer*2 days since 1st January 1950 ; Form E - Integer*2 encoded date ; Form W - Weekday Number (0 = Sunday) ; ; Author: V01 30-Jun-80 Phil Stephensen-Payne ; ; Calling Sequence: ; ; This subroutine is called via the standard FORTRAN calling sequence as: ; ; CALL GTDATI (DAY,MONTH,YEAR [,STATUS]) ; or ; STATUS = GTDATI (DAY,MONTH,YEAR) ; ; or ; CALL GTDATI from MACRO-11 with ; R5 = 0 ; R1 = DAY on output ; R2 = MONTH on output ; R3 = YEAR on output ; R0 = STATUS on output ; ; Where: ; DAY = Number of day (1-31) ; MONTH = Number of month (1-12) ; YEAR = Year since 1950 (1950=0) ; STATUS = Optional error return ; ; Errors returned: ; ; STATUS = 0 if the operation was successful ; = -1 if a parameter error was detected ; ; External references: ; ; This module calls the subroutines PRMCHK ; ; PRM:: .WORD ; Number of parameters .WORD BUFF+4 ; Address of day .WORD BUFF+2 ; Address of month .WORD BUFF ; Address of year .WORD 0,0 ; User parameters BUFF: .BLKW 8. ; To hold today's date ; ; GTDATI:: TST R5 ; Called directly from MACRO-11? BEQ 10$ ; If eq yes - omit PRMCHK ; ; Specify number of parameters including error return. R5 not affected. ; MOV #4,R0 ; Check Number of Parameters CALL PRMCHK ; BCS END ; If CS parameter error - exit at once ; 10$: GTIM$S #BUFF ; Get the date MOV BUFF,R3 ; Put the relevant bits in the registers MOV BUFF+2,R2 ; MOV BUFF+4,R1 ; TST R5 ; Called from MACRO-11 BEQ 20$ ; If EQ yes - nothing else to do TST (R5)+ ; Ignore Number of parameters MOVB R1,@(R5)+ ; Return the parameters MOVB R2,@(R5)+ ; MOVB R3,@(R5)+ ; ; 20$: CLR R0 ; Show success ; END: RETURN .END