Other Calendars for the HP-41
Overview
1°) Mayan Calendar
2°) Old Egyptian Calendar
3°) Coptic Calendar
1°) Mayan Calendar
-"DT-MY" & "MY-DT" uses the "Long Count" calendar
-It starts on -3113/08/11 Gregorian i-e September 6th , 3114
B.C. = -3313/09/06 Julian Calendar
-After 2880000 days, another cycle begins
Data Registers: /
Flags: /
Subroutines: "J2" , "J1" or "J0" and "D2"
, "D1" or "DT" ( cf Julian & Gregorian Calendars for the HP-41 )
01 LBL "DT-MY"
02 XEQ "J2" 03 1867262 04 + 05 STO Y 06 144 E3 07 ST/ Z 08 MOD 09 X<>Y 10 INT 11 E2 12 * 13 RCL Y 14 7200 15 ST/ T 16 MOD 17 X<> Z 18 INT |
19 +
20 E2 21 * 22 RCL Y 23 360 24 ST/ T 25 MOD 26 X<> Z 27 INT 28 + 29 E2 30 * 31 RCL Y 32 20 33 ST/ T 34 MOD 35 X<> Z 36 INT |
37 +
38 E2 39 * 40 + 41 RTN 42 LBL "MY-DT" 43 E8 44 / 45 FRC 46 LASTX 47 INT 48 20 49 * 50 X<>Y 51 E2 52 * 53 FRC |
54 LASTX
55 INT 56 RCL Z 57 + 58 20 59 * 60 X<>Y 61 E2 62 * 63 FRC 64 LASTX 65 INT 66 RCL Z 67 + 68 18 69 * 70 X<>Y 71 E2 |
72 *
73 FRC 74 LASTX 75 INT 76 RCL Z 77 + 78 20 79 * 80 X<>Y 81 E2 82 * 83 + 84 1867262 85 - 86 XEQ "D2" 87 END |
( 160 bytes / SIZE 000 )
STACK | INPUT1 | OUTPUT1 | INPUT2 | OUTPUT2 |
X | YYYY.MNDDGr | yyyy.mnddMy | yyyy.mnddMy | YYYY.MNDDGr |
Examples:
-3113.0811 XEQ "DT-MY" >>>>
0
R/S >>>> -3113.0811
( Gregorian )
1600.1225
R/S >>>>
11.19.02.00.04 R/S >>>>
1600.1225
2012.1221
R/S >>>>
13.00.00.00.00 R/S >>>>
2012.1221
2015.1021
R/S >>>>
13.00.02.15.14 R/S >>>>
2015.1021
4772.1012
R/S >>>>
19.19.19.17.19 R/S >>>>
4772.1012
Notes:
-These numbers are expressed in bases 20 20 20
18 20 ( from the left )
-For instance 2013.1215 = 13.00.00.17.19
-One day later, 2013.1216 = 13.00.01.00.00
2°) Old Egyptian Calendar
-The 1st day of the Old Egyptian Calendar is -746/02/18
Gregorian = -746/02/26 Julian
-A year always has 365 days, all months have 30 days except the 13th
month which has 5 days
Data Registers: R00-R01-R02: temp
Flags: /
Subroutines: "J2" , "J1" or "J0" and "D2"
, "D1" or "DT" ( cf Julian & Gregorian Calendars for the HP-41 )
01 LBL "DT-EG"
02 XEQ "J2" 03 1002907 04 + 05 ENTER 06 STO Z 07 365 08 STO 00 09 MOD 10 STO 01 11 - 12 RCL 00 13 / 14 X<> 01 |
15 30
16 / 17 INT 18 STO 02 19 30 20 * 21 RCL 01 22 RCL 00 23 * 24 + 25 - 26 1 27 ST+ 01 28 ST+ 02 |
29 ST+ Y
30 % 31 RCL 02 32 + 33 1 34 % 35 RCL 01 36 SIGN 37 * 38 RCL 01 39 + 40 RTN |
41 LBL "EG-DT"
42 INT 43 STO 01 44 LASTX 45 ABS 46 FRC 47 E2 48 STO 00 49 * 50 INT 51 LASTX 52 FRC 53 ST* 00 54 CLX |
55 30
56 ST* Y 57 - 58 RCL 00 59 + 60 RCL 01 61 365 62 ST* Y 63 - 64 + 65 1002908 66 - 67 XEQ "D2" 68 END |
( 120 bytes / SIZE 003 )
STACK | INPUT1 | OUTPUT1 | INPUT2 | OUTPUT2 |
X | YYYY.MNDDGr | yyyy.mnddEg | yyyy.mnddEg | YYYY.MNDDGr |
Examples:
-746.0218 XEQ "DT-EG"
>>>> 1.0101
R/S >>>> -3113.0811
( Gregorian )
1600.1225
R/S >>>>
2349.0530 R/S >>>> 1600.1225
2015.1021
R/S >>>>
2764.0705 R/S >>>> 2015.1021
3°) Coptic Calendar
-The Coptic Calendar looks ike the Egyptian Calendar, but there are
leap years
-The 13th months has 5 or 6 days.
-So, the mean year is 365 days 1/4, like the Julian Calendar
-The year is leap if YYYYcoptic MOD 4 = 3
-It starts on 284/08/29 Gregorian = 284/08/29 Julian
Data Registers: R00-R01-R02-R03-R04:
temp
Flags: F10
Subroutines: "J2" , "J1" or "J0" and "D2"
, "D1" or "DT" ( cf Julian & Gregorian Calendars for the HP-41 )
01 LBL "DT-CO"
02 XEQ "J2" 03 STO 02 04 626515 05 + 06 4 07 * 08 1463 09 + 10 1461 11 / 12 RCL X 13 1 14 MOD 15 - 16 STO 03 17 ENTER 18 SIGN 19 .0101 |
20 *
21 + 22 SF 10 23 XEQ 01 24 RCL 02 25 X<>Y 26 - 27 30 28 / 29 INT 30 1 31 + 32 .01 33 + 34 1 35 % 36 RCL 03 37 SIGN 38 * |
39 RCL 03
40 + 41 STO 04 42 XEQ 01 43 RCL 02 44 X<>Y 45 - 46 E4 47 / 48 RCL 04 49 SIGN 50 * 51 RCL 04 52 + 53 CF 10 54 RTN 55 LBL "CO-DT" 56 CF 10 |
57 LBL 01
58 INT 59 STO 01 60 LASTX 61 ABS 62 FRC 63 E2 64 STO 00 65 * 66 INT 67 LASTX 68 FRC 69 ST* 00 70 CLX 71 30 72 ST* Y 73 - 74 RCL 00 75 + |
76 RCL 01
77 365 78 ST* Y 79 - 80 + 81 RCL 01 82 4 83 / 84 RCL X 85 1 86 MOD 87 - 88 + 89 626516 90 - 91 FS? 10 92 RTN 93 XEQ "D2" 94 END |
( 159 bytes / SIZE 005 )
STACK | INPUT1 | OUTPUT1 | INPUT2 | OUTPUT2 |
X | YYYY.MNDDGr | yyyy.mnddCo | yyyy.mnddCo | YYYY.MNDDGr |
Examples:
284.0829 XEQ "DT-CO"
>>>> 1.0101
R/S >>>> 284.0829
( Gregorian or Julian ! )
1600.1225
R/S >>>>
1317.0419 R/S >>>>
1600.1225
2015.1021
R/S >>>>
1732.0210 R/S >>>>
2015.1021
Reference:
[1] Nachum Dershowitz & Edward M. Reingold - "Calendrical
Calculations" - Cambridge University Press - ISBN 978-0-521-70238-6