A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).



Task

In what years between 2008 and 2121 will the 25th of December be a Sunday?

Using any standard date handling libraries of your programming language;
compare the dates calculated with the output of other languages to discover any anomalies in the handling of dates which may be due to, for example, overflow in types used to represent dates/times similar to   y2k   type problems.




*        Day of the week           06/07/2016
DOW      CSECT
         USING  DOW,R15            base register
         LA     R6,2008            year=2008
LOOP     C      R6,=F'2121'        do year=2008 to 2121
         BH     ELOOP              .
         LR     R7,R6              y=year
         LA     R8,12              m=12
         LA     R9,25              d=25
         C      R8,=F'3'           if m<3
         BNL    MGE3               then
         LA     R8,12(R8)            m=m+12
         BCTR   R7,0                 y=y-1
MGE3     LR     R10,R7             y
         SRDA   R10,32             .
         D      R10,=F'100'        r=y//100 ; l=y/100
         LR     R3,R8              m
         LA     R3,1(R3)           m+1
         M      R2,=F'26'          *26
         D      R2,=F'10'          /10
         AR     R3,R9              +d
         AR     R3,R10             +r
         LR     R2,R10             r
         SRA    R2,2               /4
         AR     R2,R3              (d+(m+1)*26/10+r+r/4
         LR     R3,R11             l
         SRA    R3,2               /4
         AR     R2,R3              (d+(m+1)*26/10+r+r/4+l/4
         LA     R5,5               5
         MR     R4,R11             *l
         AR     R2,R5              (d+(m+1)*26/10+r+r/4+l/4+5*l)
         SRDA   R2,32              .
         D      R2,=F'7'           w=(d+(m+1)*26/10+r+r/4+l/4+5*l)//7
         C      R2,=F'1'           if w=1  (sunday)
         BNE    WNE1               then
         XDECO  R6,PG                edit year
         XPRNT  PG,12                print year
WNE1     LA     R6,1(R6)           year=year+1
         B      LOOP               next year
ELOOP    BR     R14                exit
PG       DS     CL12               buffer
         YREGS
         END    DOW