.TITLE DATE .IDENT /V1.04/ .ENABL DBG ; DATE for Whitesmith's C and Pascal. VAX/VMS version. ; ; Author: C.J. Doran, Sira Ltd., South Hill, Chislehurst, Kent, BR7 5EH, England. ; Tel: +44 1 467 2636, Telex: 896649, Fax: +44 1 467 6515 ; ; Assemble as: ; >MAC DATE ;+ ; Return 10 or 11 character string containing date in form [d]d:mmm:yyyy, to ; area addressed by entry parameter. String is terminated by a null, so ; the area must actually be 12 bytes long. ;- ; MODIFICATIONS RECORD ; ==================== ; V1.02 11-Nov-82 CJD ; Compute string length, rather than assume it to be 9 chars, in case ; day is in range 1-9 and zero-suppressed. ; ; V1.03 16-Aug-84 CJD ; Put 2nd two letters of month in lower-case. ; ; V1.04 7-Aug-85 CJD ; VAX/VMS version. Note that year is 4 digits (2 on PDP). .PSECT C$TEXT,SHR,NOWRT,QUAD SPACE=^O40 .ENTRY DATE,^M<> PUSHL 4(AP) ; Form a string descriptor PUSHL #11 ; For max 11-char string MOVL SP,R1 ; Load pointer to it PUSHL #0 ; CVTFLG=0 PUSHL #0 ; TIMADR=0 -- fetch date now PUSHR #^M ; TIMBUF-> string descriptor PUSHL #0 ; TIMLEN=0 -- not needed CALLS #4,G^SYS$ASCTIM ; Get ASCII date MOVL 4(SP),R1 ; Get pointer to start BISW2 #^X2020,4(R1) ; Make 2nd 2 letters of month lower-case MOVL #11,R0 ; Assume we have 11 chars CMPB (R1)+,#SPACE ; If 1st char is a digit (not space) BNEQ 10$ ; that's it DECL R0 ; Else only have 10 MOVQ (R1),-1(R1) ; Move down first 8 MOVW 8(R1),7(R1) ; and last 2 10$: CLRB @4(AP)[R0] ; Terminate with null RET ; Done .END