-2,3
MODULE KMOVLY,VERSION=6302,COMMENT=<KMON Overlays>

-21
       .SBTTL  Post-Release Edit History

;+
;
; SLP patches Copyright (c) 2000 Megan Gentry, All Rights Reserved
;
; This file  contains source  code modifications  which were  distributed
; through use of a Source Language Patch (SLP) file.  These modifications
; are unofficial  changes.   They were not developed,  reviewed or tested
; by, and have not been approved by Digital Equipment Corporation, Compaq
; Computer Corporation,   or Mentec, Ltd,   and they are not supported by
; these organizations.
;
; These modifications  may only  be used  with the  inclusion of both the
; above copyright notice and the full text of these comments.
;
; The  author   has  used  best  efforts  in  the  preparation  of  these
; modifications.    These  efforts  include  research,   development  and
; testing.   The  author makes  no warranty  of any  kind,  expressed  or
; implied,  with regard to these changes.  The author shall not be liable
; in  any  event for  incidental or  consequential damages  in connection
; with, or arising out of, the use or performance of these changes.   Use
; of these modifications constitutes acceptance of these terms.
;
; The author  is interested  in any  comments or  reports of problems and
; will  make a  best effort  at determining  if a  problem is a result of
; these modifications  or if  it exists  in the distributed code.  Please
; report any problems to <[email protected]>
;
; (01) 10-Jan-2000 Megan Gentry
;       o DATE command: The code rejected date words with the high order
;         (epoch) bits set.  This restriction has been removed.
;       o DATE command: The code rejected date words with the year offset
;         field bits zero.  This caused 1972 to be rejected as invalid.
;         This has been corrected.
;
; (02) 11-Jan-2000 Megan Gentry
;       o DATE command: Y2K and extended date support has been included.
;         Dates in year range 72-99 are accepted as meaning 1972-1999
;         Dates in year range 00-71 are accepted as meaning 2000-2071
;         Dates in year range 1972-2099 are accepted as is.  Note that
;         although the date may be accepted in a two-digit form, it will
;         always be reported in a four-digit form.
;
;-

-333,334
       OJSR    PC,DECNUM               ;Get the specified year
       TST     @SP                     ;Is it positive?
       BMI     10$                     ;No, so it can't be valid...
       SUB     #1972.,@SP              ;Is it a valid four-digit year?
       BGE     42$                     ;Maybe, check the upper limit
       ADD     #<1972.-99.>,@SP        ;No, can it be a valid two-digit year?
       BGT     10$                     ;Nope, too high...
       ADD     #<99.-72.>,@SP          ;Yes, but in which range?
       BGE     42$                     ; ... in range 72..99
       ADD     #<2000.-1900.>,@SP      ; ... in range 00..71, add 100.
42$:    CMP     @SP,#<2099.-1972.>      ;So, is the year in range 0 - 127.?
       BGT     10$                     ;Nope, patently invalid...
       MOV     @SP,-(SP)               ;Copy the year info
       BIC     #^C<37>,2(SP)           ;Isolate the year field
       BIC     #<37>,@SP               ;Isolate the epoch info
       ASL     @SP                     ;Shift epoch to its place
       SWAB    @SP                     ; in an RT-11 extended date word
       BIS     (SP)+,@SP               ;Merge epoch with year
       BIS     (SP)+,R1                ; and merge both with date word
-346,362
       BEQ     9$                      ;If date is not set at all...
       MOV     R2,R0                   ;Copy the date
       BIC     #^C<31.*40>,R0          ;Isolate the day field
       BEQ     9$                      ;A zero day is invalid...
       ASL     R0                      ;And shift it
       ASL     R0                      ; from <09:05>
       ASL     R0                      ;  to <04:00>
       SWAB    R0                      ;   ...
       CALL    R10ONF                  ;Print it out
       MOV     R2,-(SP)                ;Copy the date (for year output)
       MOV     R2,-(SP)                ;Copy the date (for month output)
       BIC     #^C<15.*2000>,@SP       ;Isolate the month field
       SUB     #<1*2000>,@SP           ;Reduce range from 1-12 to 0-11
       SWAB    @SP                     ;Shift from <13:10> to <05:02>
                                       ; (used for index into month string)
-368,371
       MOV     @SP,R2                  ;R2 = Date word
       BIC     #^C<37>,R2              ;Isolate the year offset
       BIC     #^C<3*40000>,@SP        ;Isolate the epoch
       SWAB    @SP                     ;Shift it
       ASR     @SP                     ; ...
       BIS     (SP)+,R2                ;Merge with year offset
       ADD     #72.,R2                 ;Add in base RT year
       MOV     #19.,R0                 ;Assume 19xx
       CMP     R2,#100.                ;Correct assumption?
       BLO     85$                     ;Yep...
       INC     R0                      ;Nope, 20xx...
       SUB     #100.,R2                ;Reduce to range 00-99
85$:    CALL    R10OUT                  ;Output century
       MOV     R2,R0                   ;R0 = YY
       CALL    R10OUT                  ;Output year
/