.TITLE JDATE ;+ ; JDATE is a fortran callable routine to convert the month, day, ; and year to the internal RT11 INTEGER*2 date format. On input, ; the month, day, and year should be as follows: ; ; month is a 0 > month <= 12 INTEGER*2 value ; day is a 0 > day <= 31 INTEGER*2 value ; year is a 71 > year <= 103 INTEGER*2 value ; ; Input parameters: month, day, year (Integer*2) ; Output parameter: intdat (Integer*2) ; ; The calling sequence is: ; CALL JDATE ( month , day , year , intdat ) ; ; Actions: ; R0 and R1 are destroyed. ;- .JDATE==1 .PSECT SYS$I I,LCL,REL,CON JDATE:: TST (R5)+ ; ignore parameter count CLR R0 ; init as buffer MOV @(R5)+,-(SP) ; save month on stack MOV @(R5)+,R1 ; R1 = day SWAB R1 ; shift in position ASR R1 ; ... ASR R1 ; ... ASR R1 ; ... BIC #^C1740,R1 ; make sure only bits 5 to 9 are on BIS R1,R0 ; set day in buffer MOV (SP)+,R1 ; R1 = month ASL R1 ; shift in position ASL R1 ; ... SWAB R1 ; ... BIC #^C36000,R1 ; make sure only bits 10 to 13 are on BIS R1,R0 ; set month in buffer MOV @(R5)+,R1 ; R1 = year CMP #1900.,R1 ; more than two digits? BHI 10$ ; branch if not SUB #1900.,R1 ; make it two digits 10$: SUB #72.,R1 ; subtract offset BIC #^C37,R1 ; make sure only bits 0 to 4 are on BIS R1,R0 ; set result in buffer MOV R0,@(R5) ; store result in intdat RETURN .END