0010 BEG  JMP PPCL
0020 SP   EQU M
0030 CLS  EQU 04231H
0040 MUSC EQU 072C5H
0050 CGET EQU 012CBH
0060 INLN EQU 04644H
0070 IBUF EQU 0F685H
0080 ERLN EQU 0425DH
0090 POSC EQU 0F639H
0100 CRLF EQU 04222H
0110 MENU EQU 05797H
0120 ONRV EQU 04269H
0130 OFRV EQU 0426EH
0140 MSG1 DW 'HW'
0150  DW 'TA'
0160  DW 'Y '
0170  DW 'AE'
0180  DW ' R'
0190  DW '1('
0200  DW '89'
0210  DW ')4'
0220  DB ' '
0230  DB 0DH
0240 MSG2 DW 'HW'
0250  DW 'TA'
0260  DW 'M '
0270  DW 'NO'
0280  DW 'HT'
0290  DW '( '
0300  DW '-1'
0310  DW '21'
0320  DW ' )'
0330  DB 0DH
0340 MSG3 DW 'US'
0350  DW ' N'
0360  DW 'M '
0370  DW 'NO'
0380  DW '  '
0390  DW 'UT'
0400  DW ' E'
0410  DW 'W '
0420  DW 'DE'
0430  DW '  '
0440  DW 'HT'
0450  DW ' U'
0460  DW 'F '
0470  DW 'IR'
0480  DW '  '
0490  DW 'AS'
0500  DB 'T'
0510  DB 0DH
0520 MSG4 DW 'EP'
0530  DW 'PR'
0540  DW 'TE'
0550  DW 'AU'
0560  DW ' L'
0570  DW 'AC'
0580  DW 'EL'
0590  DW 'DN'
0600  DW 'RA'
0610  DW '( '
0620  DW ')C'
0630  DB 0DH
0640 MSG5 DW 'YB'
0650  DW 'B '
0660  DW 'BO'
0670  DW 'J '
0680  DW 'CA'
0690  DB 'K'
0700  DB 0DH
0710 YEAR DS 2
0720 YRHI DS 1
0730 YRLO DS 1
0740 YRFL DS 1
0750 MNTH DS 1
0760 TMP1 DS 2
0770 DAYS DS 1
0780 TBL1 DB 0
0790  DB 31
0800  DB 28
0810  DB 31
0820  DB 30
0830  DB 31
0840  DB 30
0850  DB 31
0860  DB 31
0870  DB 30
0880  DB 31
0890  DB 30
0900  DB 31
0910 TBL2 DW 0
0920  DW M1
0930  DW M2
0940  DW M3
0950  DW M4
0960  DW M5
0970  DW M6
0980  DW M7
0990  DW M8
1000  DW M9
1010  DW M10
1020  DW M11
1030  DW M12
1040 M1 DW 'AJ'
1050  DW 'UN'
1060  DW 'RA'
1070  DB 'Y'
1080  DB 0DH
1090 M2 DW 'EF'
1100  DW 'RB'
1110  DW 'AU'
1120  DW 'YR'
1130  DB 0DH
1140 M3 DW 'AM'
1150  DW 'CR'
1160  DB 'H'
1170  DB 0DH
1180 M4 DW 'PA'
1190  DW 'IR'
1200  DB 'L'
1210  DB 0DH
1220 M5 DW 'AM'
1230  DB 'Y'
1240  DB 0DH
1250 M6 DW 'UJ'
1260  DW 'EN'
1270  DB 0DH
1280 M7 DW 'UJ'
1290  DW 'YL'
1300  DB 0DH
1310 M8 DW 'UA'
1320  DW 'UG'
1330  DW 'TS'
1340  DB 0DH
1350 M9 DW 'ES'
1360  DW 'TP'
1370  DW 'ME'
1380  DW 'EB'
1390  DB 'R'
1400  DB 0DH
1410 M10 DW 'CO'
1420  DW 'OT'
1430  DW 'EB'
1440  DB 'R'
1450  DB 0DH
1460 M11 DW 'ON'
1470  DW 'EV'
1480  DW 'BM'
1490  DW 'RE'
1500  DB 0DH
1510 M12 DW 'ED'
1520  DW 'EC'
1530  DW 'BM'
1540  DW 'RE'
1550  DB 0DH
1560 TBL3 DB 0
1570  DB 14
1580  DB 14
1590  DB 15
1600  DB 15
1610  DB 16
1620  DB 16
1630  DB 16
1640  DB 15
1650  DB 13
1660  DB 14
1670  DB 14
1680  DB 14
1690 PPCL LXI SP,EOP+256
1700  CALL LNS
1710  CALL CLS
1720  LXI H,0904H
1730  SHLD POSC
1740  LXI H,MSG1
1750  CALL SCRN
1760  CALL BEEP
1770  CALL INLN
1780  LXI B,IBUF
1790  CALL ADEC
1800  JC PPCL
1810  CALL LWYR
1820  JC PPCL
1830  SHLD YEAR
1840  MVI B,0
1850  CALL HILO
1860  LDA YRHI
1870  CPI 100
1880  JNC PPCL
1890 PPC1 LXI H,0905H
1900  SHLD POSC
1910  CALL ERLN
1920  LXI H,MSG2
1930  CALL SCRN
1940  CALL BEEP
1950  CALL INLN
1960  LXI B,IBUF
1970  CALL ADEC
1980  JC PPC1
1990  CALL LMTH
2000  JC PPC1
2010  MOV A,L
2020  STA MNTH
2030 *
2040 * CALCULATE DAY
2050 *
2060 PPC2 LXI H,0
2070  SHLD TMP1
2080  LHLD YEAR
2090  DCX H
2100  MVI B,0
2110  CALL HILO
2120  LDA YRHI
2130  CMA
2140  ADI 125
2150  MOV B,A
2160  LDA YRLO
2170  CPI 4
2180  CNC LPYR
2190  LDA YRLO
2200  ADD B
2210  STA TMP1
2220  LDA YRHI
2230  MVI B,0
2240  CALL LPYR
2250  LDA TMP1
2260  SUB B
2270  STA TMP1
2280  CALL MDAT
2290  CALL RLDN
2300 *
2310 * DISPLAY
2320 *
2330  CALL CLS
2340  CALL DMTH
2350  CALL YRSR
2360  LXI H,0402H
2370  SHLD POSC
2380  LXI H,MSG3
2390  CALL SCRN
2400  CALL PCAL
2410 INLP LXI H,0108H
2420  SHLD POSC
2430  CALL CGET
2440  CPI 8
2450  JZ PPCL
2460  CPI 27
2470  JZ EPRO
2480  CPI 30
2490  JZ UPYR
2500  CPI 31
2510  JZ DNYR
2520  CPI 28
2530  JZ UPMO
2540  CPI 29
2550  JZ DNMO
2560  JMP INLP
2570 EPRO CALL LNS
2580  JMP MENU
2590 SCRN MOV A,M
2600  CPI 0DH
2610  RZ
2620  RST 4
2630  INX H
2640  JMP SCRN
2650 BEEP LXI D,750
2660  MVI B,5
2670  JMP MUSC
2680 BPLO LXI D,2750
2690  MVI B,5
2700  JMP MUSC
2710 ADEC LXI H,0
2720 ADE1 LDAX B
2730  ORA A
2740  RZ
2750  MOV D,H
2760  MOV E,L
2770  DAD H
2780  DAD H
2790  DAD D
2800  DAD H
2810  SUI 30H
2820  CPI 10
2830  CMC
2840  RC
2850  MOV E,A
2860  MVI D,0
2870  DAD D
2880  INX B
2890  JMP ADE1
2900 LWYR LXI D,1582
2910  MOV A,H
2920  CMP D
2930  RNZ
2940  MOV A,L
2950  CMP E
2960  RET
2970 LMTH MOV A,L
2980  CPI 1
2990  RC
3000  CPI 13
3010  CMC
3020  RC
3030  MOV A,H
3040  CPI 1
3050  CMC
3060  RET
3070 LPYR INR B
3080  SUI 4
3090  CPI 4
3100  JNC LPYR
3110  RET
3120 RLDN LHLD TMP1
3130  MOV A,H
3140  JMP RLD2
3150 RLD1 MOV A,L
3160  SUI 7
3170  MOV L,A
3180  MOV A,H
3190  SBI 0
3200  MOV H,A
3210 RLD2 ORA A
3220  JNZ RLD1
3230  MOV A,L
3240  CPI 8
3250  JNC RLD1
3260  STA DAYS
3270  RET
3280 HILO MOV A,L
3290  SUI 100
3300  MOV L,A
3310  MOV A,H
3320  SBI 0
3330  MOV H,A
3340  INR B
3350  ORA A
3360  JNZ HILO
3370  MOV A,L
3380  CPI 100
3390  JNC HILO
3400  MOV A,B
3410  STA YRHI
3420  MOV A,L
3430  STA YRLO
3440  RET
3450 MDAT MVI D,0
3460  MVI B,0
3470  LDA MNTH
3480  MOV C,A
3490  DCR C
3500  CNZ MDT1
3510  LDA MNTH
3520  CPI 3
3530  RC
3540  LHLD YEAR
3550  MVI B,0
3560  CALL HILO
3570  LDA YRHI
3580  MVI B,0
3590  CALL LPYR
3600  ORA A
3610  RZ
3620  LDA YRLO
3630  MVI B,0
3640  CALL LPYR
3650  ORA A
3660  RNZ
3670  LHLD TMP1
3680  INX H
3690  SHLD TMP1
3700  RET
3710 MDT1 LXI H,TBL1
3720  DAD B
3730  MOV E,M
3740  LHLD TMP1
3750  DAD D
3760  SHLD TMP1
3770  DCR C
3780  JNZ MDT1
3790  RET
3800 UPMO LDA MNTH
3810  INR A
3820  STA MNTH
3830  CPI 13
3840  JC PPC2
3850  MVI A,1
3860  STA MNTH
3870  JMP UPYR
3880 DNMO LDA MNTH
3890  DCR A
3900  STA MNTH
3910  CPI 1
3920  JNC PPC2
3930  MVI A,12
3940  STA MNTH
3950  JMP DNYR
3960 UPYR LHLD YEAR
3970  INX H
3980  SHLD YEAR
3990  JMP PPC2
4000 DNYR LHLD YEAR
4010  DCX H
4020  SHLD YEAR
4030  JMP PPC2
4040 DMTH MVI D,0
4050  LDA MNTH
4060  MOV E,A
4070  LXI H,TBL3
4080  DAD D
4090  MOV A,M
4100  MOV H,A
4110  MVI L,1
4120  SHLD POSC
4130  MVI D,0
4140  LDA MNTH
4150  RLC
4160  MOV E,A
4170  LXI H,TBL2
4180  DAD D
4190  MOV E,M
4200  INX H
4210  MOV D,M
4220  XCHG
4230  CALL SCRN
4240  MVI A,20H
4250  RST 4
4260  RET
4270 YRSR MVI B,0
4280  LHLD YEAR
4290  CALL HILO
4300  LDA YRHI
4310  CALL DODG
4320  LXI H,YRFL
4330  MVI M,1
4340  LDA YRLO
4350  CALL DODG
4360  MVI M,0
4370  RET
4380 DODG MVI B,0
4390  MOV C,A
4400  CPI 10
4410  JC DOD3
4420 DOD1 SUI 10
4430  INR B
4440  CPI 10
4450  JNC DOD1
4460  MOV C,A
4470  MOV A,B
4480  ADI 30H
4490  RST 4
4500 DOD2 MOV A,C
4510  ADI 30H
4520  RST 4
4530  RET
4540 DOD3 LDA YRFL
4550  ORA A
4560  JZ DOD4
4570  MVI A,30H
4580  RST 4
4590  JMP DOD2
4600 DOD4 MVI A,20H
4610  RST 4
4620  JMP DOD2
4630 TAB MVI B,4
4640 TAB1 MVI A,20H
4650  RST 4
4660  DCR B
4670  JNZ TAB1
4680  RET
4690 TAB2 MVI B,5
4700  CALL TAB1
4710  DCR C
4720  JNZ TAB2
4730  RET
4740 PCAL CALL CRLF
4750  LDA MNTH
4760  MVI D,0
4770  MOV E,A
4780  LXI H,TBL1
4790  DAD D
4800  MOV E,M
4810  MVI D,1
4820  LDA MNTH
4830  CPI 2
4840  CZ CKMO
4850  LDA DAYS
4860  DCR A
4870  JZ PCAL2
4880  MOV C,A
4890  CALL TAB
4900  CALL TAB2
4910 PCAL1 CALL DODY
4920  LDA DAYS
4930  DCR A
4940  INR D
4950  ADD D
4960  CPI 8
4970  JC PCAL1
4980  CALL CRLF
4990 PCAL2 CALL TAB
5000  MVI B,7
5010 PCAL3 CALL DODY
5020  MOV A,D
5030  CMP E
5040  RZ
5050  INR D
5060  DCR B
5070  JNZ PCAL3
5080  CALL CRLF
5090  JMP PCAL2
5100 DODY PUSH B
5110  PUSH D
5120  PUSH H
5130  LXI H,YRFL
5140  MVI M,0
5150  MOV A,D
5160  CALL DODG
5170  MVI B,3
5180  CALL TAB1
5190  POP H
5200  POP D
5210  POP B
5220  RET
5230 CKMO MVI B,0
5240  LDA YRHI
5250  CALL LPYR
5260  ORA A
5270  RZ
5280  MVI B,0
5290  LDA YRLO
5300  CALL LPYR
5310  ORA A
5320  RNZ
5330  INR E
5340  RET
5350 LNS CALL CLS
5360  CALL ONRV
5370  LXI H,0202H
5380  SHLD POSC
5390  MVI B,38
5400  CALL TAB1
5410  LXI H,0202H
5420  CALL DNLN
5430  LXI H,2702H
5440  CALL DNLN
5450  LXI H,0207H
5460  SHLD POSC
5470  MVI B,38
5480  CALL TAB1
5490  CALL OFRV
5500  JMP NAME
5510 DNLN MVI B,6
5520 DNLN1 SHLD POSC
5530  MVI A,20H
5540  RST 4
5550  INX H
5560  DCR B
5570  RZ
5580  JMP DNLN1
5590 NAME LXI H,0904H
5600  SHLD POSC
5610  LXI H,MSG4
5620  CALL SCRN
5630  LXI H,0E05H
5640  SHLD POSC
5650  LXI H,MSG5
5660  CALL SCRN
5670  MVI C,7
5680 NM1 PUSH B
5690  CALL BEEP
5700  CALL BPLO
5710  POP B
5720  DCR C
5730  JNZ NM1
5740  RET
5750 EOP EQU $
