> Z80.ProgTips.DofWeek  Calculate day of week : ( mc% 59 2 P=0 1 <P%=mc%:O%=P% F[OPT P*3+4 P\ On entry B =day, 1..31 Z\ C =month, 1..12 d$\ E =year-1900, 0..255 nB\ On exit A=day of week 0..6 for Sun..Sat, Carry will be Set x>\ Needs incrementing with INC A after calling to *\ become standard 1..7 range \ Size 51 bytes \ .DayOfWeek . DayOfWeek0:LD L,A:EXX:RET :\ Test entry : .DayOfWeek0 ;LD A,C:CP 3 :\ Is month March or later? 3LD A,E :\ A=year for later MJR NC,dow_march :\ Start year in March make leap years easier U A:JR NZ,dow_1901:LD A,6 :\ Adjust for 1900 - include this line for Jan/Feb 1900 .dow_1901 @DEC A:LD E,A :\ If Jan or Feb, decrement year .dow_march BCP 2100-1900:CCF:SBC A,0 :\ Adjust for 2100 not a leap year @ dow_mod7 :\ Get year 7 to prevent overflow "/ADD A,B :\ A=day + year ,8SRL E:SRL E:ADD A,E :\ A=day + year + year/4 62LD HL,dow_months-1 :\ HL=>month table @3LD B,0:ADD HL,BC :\ HL=>month offset JDADD A,(HL) :\ A=day + offset[m] + year + year/4 T .dow_mod7 ^ADD A,7:JR NC,dow_mod7 hRET r.dow_months |(B 2:B 5:B 4:B 0 :\ Month offsets B 2:B 5:B 0:B 3 B 6:B 1:B 4:B 6 ] 4ݤday(A%):="000SunMonTueWedThuFriSat",A%*3+1,3)  C%=1 12  B%=1 31 M U%= DayOfWeek: B%;"/";C%;"/";1900+E%;" - ";day(1+(U% 255));" ";~U%