HP-41 Fast Calendar Printer Program

Back to main page | Email me at: Gene!


This program first appeared in the V7N6P15 (July/Aug 1980) issue of the PPC Journal and was written by Roger Hill. Thanks to Roger who I think is still in Chicago today and a fellow member of the CHiP chapter!

This program was part of the ongoing Great Calendar Race between the TI and HP user groups to develop the fastest program to print out a year's calendar. The TI group held the lead for a while and then the HP group countered them. Roger Hill, in addition to being a great force behind the PPC ROM, was the most visible HP contestant in the race.

Roger's first calendar program cranked out a year's print in a little under 4 minutes. He was satisfied with this until he read that the TI group had a program that printed a year in 2 minutes 38 seconds. The program below was created in response to this TI program.

The fastest TI-59 program to print out a year's calendar used fast mode and was developed by Palmer Hanson and finishes in 1 minute 32 seconds. Roger later passed that mark with a final revision to the program.

The program presented below is a little over 370 bytes long and requires 4 data memories. It will crank out a printed one year calendar in about 2 minutes and 20 seconds. This was NOT the ultimately fast HP-41 calendar printing program. That one would crank out a year in 1 minute 14 seconds! However THAT program was huge, requiring about 3 times as much program storage space.

Instructions: When the program is run, you will be prompted for the START YEAR. Enter the year to print or start with and press R/S. Then you will be prompted for MONTH 0-12. If you enter a zero, the entire year will be printed. Anything other than a zero will cause the third prompt to show NUM MONTHS. This allows part of a year or more than a year to be printed.

Program Listing: The listing is presented below. RUP stands for Roll Up.


Line      Instruction
01         LBL "CAL"
02         "START YEAR?"
03         PROMPT
04         INT
05         X < = 0?
06         LN
07         STO 01
08         0.23
09         -
10         STO 00
11         CLX
12         "MONTH? 0-12"
13         PROMPT
14         ABS
15         INT
16         ENTER
17         X = 0?
18         SIGN
19         STO 02
20         12
21         STO 03
22         X < Y?
23         ASIN
24         /
25         ST+ 00
26         X > Y?
27         GTO 10
28         SIGN
29         "NUM MONTHS?"
30         PROMPT
31         INT
32         STO 03
33         LBL 10
34         PRBUF
35         FIX 0
36         CF 29
37         0.012
38         ST+ 02
39         31
40         RCL 00
41         *
42         INT
43         RCL 00
44         INT
45         STO 00
46         1
47         %
48         INT
49         0.75
50         ST* 00
51         *
52         +
53         -
54         INT
55         RCL 00
56         -
57         INT
58         3
59         +
60         7 E-5
61         +
62         STO 00
63         LBL 20
64         SF 12
65         CLX
66         ADV
67         XEQ IND 02
68         GTO 13
69         LBL 01
70         "JAN"
71         RTN
72         LBL 03
73         "MAR"
74         RTN
75         LBL 05
76         "MAY"
77         RTN
78         LBL 07
79         "JUL"
80         RTN
81         LBL 08
82         "AUG"
83         RTN
84         LBL 10
85         "OCT"
86         RTN
87         LBL 12
88         "DEC"
89         RTN
90         LBL 04
91         "APR"
92         SIGN
93         RTN
94         LBL 06
95         "JUN"
96         SIGN
97         RTN
98         LBL 09
99         "SEP"
100        SIGN
101        RTN
102        LBL 11
103        "NOV"
104        SIGN
105        RTN
106        LBL 02
107        "FEB"
108        SIGN
109        RCL 01
110        %
111        ENTER
112        INT
113        X NE Y?
114        RCL 01
115        4
116        MOD
117        X NE 0?
118        SIGN
119        2
120        +
121        RTN
122        LBL 13
123        ACA
124        RCL 01
125        ACX
126        2
127        SKPCHR
128        ADV
129        CF 12
130        24
131        RUP
132        -
133        RCL 00
134        7
135        MOD
136        +
137        STO 00
138        "   SU MO TU WE"
139        ->" TH FR SA"
140        PRA
141        3
142        LASTX
143        *
144        SKPCHR
145        " "
146        ACA
147        9 E-3
148        SF 10
149        GTO IND L
150        LBL 14
151        GTO IND Z
152        LBL 00
153        ISG X
154        ACA
155        ACX
156        LBL 01
157        ISG X
158        ACA
159        ACX
160        LBL 02
161        ISG X
162        ACA
163        ACX
164        LBL 03
165        ISG X
166        ACA
167        ACX
168        LBL 04
169        ISG X
170        ACA
171        ACX
172        LBL 05
173        ISG X
174        ACA
175        ACX
176        LBL 06
177        ISG X
178        ACA
179        ACX
180        PRBUF
181        ACA
182        DSE Z
183        GTO 00
184        FS?C 10
185        GTO 14
186        ISG 02
187        GTO 10
188        12
189        ST- 02
190        ISG 01
191        LBL 10
192        DSE 03
193        GTO 20
194        ADV
195        ADV
196        ADV
197        ADV
198        ADV
199        END