HP Forums
(DM42, Free42) Scolling clock - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (DM42, Free42) Scolling clock (/thread-17185.html)



(DM42, Free42) Scolling clock - arhtur - 06-30-2021 02:20 AM

In the 1970's and 1980's digital clocks with scrolling numbers were common.

In an effort to replicate this type of clock, I made a scrolling clock program. It is rather basic, with only the ones digit of the seconds scrolling, but could be modified to have more features.

Registers 00 to 04 are used to hold 5 columns of bitmaps of numbers. The 8 least significant bits hold the current number and the 8 most significant bits hold the next number. The program does an AND with each column register and 255 and does XTOA which fills the alpha register. Then, these registers are divided by 2 until the next digit is completely displayed.

To run the clock, XEQ ACLK

You must also have the DIG program which provides the bitmap data to fill registers 00 to 04. DIG takes the desired digit and does indirect addressing to GTO the correct subroutine.

This is too processor intensive to run on the HP 42s, but seems to run well on the DM42 and Free42.

Code:

00 { 271-Byte Prgm }
01▸LBL "ACLK"
02 "GrMod"
03 CF 34
04 CF 35
05 ASTO 13
06 4
07 STO IND 13
08 "RefLCD"
09 ASTO 14
10 128
11 STO "M"
12 TIME
13 STO "L"
14 VIEW "L"
15 CF 34
16 SF 35
17 0
18 STO "C"
19 TIME
20 1ᴇ4
21 ×
22 10
23 MOD
24 STO "N"
25 XEQ "DIG"
26▸LBL A
27 CLA
28 RCL 04
29 255
30 AND
31 XTOA
32 RCL 03
33 255
34 AND
35 XTOA
36 RCL 02
37 255
38 AND
39 XTOA
40 RCL 01
41 255
42 AND
43 XTOA
44 RCL 00
45 255
46 AND
47 XTOA
48 2
49 STO÷ 00
50 2
51 STO÷ 01
52 2
53 STO÷ 02
54 2
55 STO÷ 03
56 2
57 STO÷ 04
58 TIME
59 IP
60 9
61 X<Y?
62 GTO "B2"
63 1
64 43
65 AGRAPH
66 GTO "B3"
67▸LBL "B2"
68 1
69 49
70 AGRAPH
71▸LBL "B3"
72 -7
73 STO IND 14
74 TIME
75 1ᴇ5
76 ×
77 IP
78 STO "L"
79▸LBL "B1"
80 TIME
81 1ᴇ5
82 ×
83 IP
84 RCL "L"
85 X=Y?
86 GTO "B1"
87 1
88 STO+ "C"
89 RCL "C"
90 8
91 X≥Y?
92 GTO A
93 TIME
94 1ᴇ4
95 ×
96 IP
97 STO "L"
98▸LBL B
99 TIME
100 1ᴇ4
101 ×
102 IP
103 RCL "L"
104 X=Y?
105 GTO B
106 GTO "ACLK"
107 END

Code:

00 { 441-Byte Prgm }
01▸LBL "DIG"
02 1
03 STO "M"
04 0
05 STO 00
06 0
07 STO 01
08 0
09 STO 02
10 0
11 STO 03
12 0
13 STO 04
14 XEQ IND "N"
15 256
16 STO "M"
17 1
18 RCL "N"
19 +
20 10
21 MOD
22 STO "N"
23 XEQ IND "N"
24 RTN
25▸LBL 01
26 64
27 RCL "M"
28 ×
29 STO+ 01
30 127
31 RCL "M"
32 ×
33 STO+ 02
34 66
35 RCL "M"
36 ×
37 STO+ 03
38 RTN
39▸LBL 02
40 70
41 RCL "M"
42 ×
43 STO+ 00
44 73
45 RCL "M"
46 ×
47 STO+ 01
48 73
49 RCL "M"
50 ×
51 STO+ 02
52 81
53 RCL "M"
54 ×
55 STO+ 03
56 98
57 RCL "M"
58 ×
59 STO+ 04
60 RTN
61▸LBL 03
62 54
63 RCL "M"
64 ×
65 STO+ 00
66 73
67 RCL "M"
68 ×
69 ENTER
70 ENTER
71 STO+ 01
72 STO+ 02
73 STO+ 03
74 34
75 RCL "M"
76 ×
77 STO+ 04
78 RTN
79▸LBL 04
80 16
81 RCL "M"
82 ×
83 STO+ 00
84 127
85 RCL "M"
86 ×
87 STO+ 01
88 18
89 RCL "M"
90 ×
91 STO+ 02
92 20
93 RCL "M"
94 ×
95 STO+ 03
96 24
97 RCL "M"
98 ×
99 STO+ 04
100 RTN
101▸LBL 05
102 57
103 RCL "M"
104 ×
105 STO+ 00
106 69
107 RCL "M"
108 ×
109 ENTER
110 ENTER
111 STO+ 01
112 STO+ 02
113 STO+ 03
114 39
115 RCL "M"
116 ×
117 STO+ 04
118 RTN
119▸LBL 06
120 48
121 RCL "M"
122 ×
123 STO+ 00
124 73
125 RCL "M"
126 ×
127 ENTER
128 STO+ 01
129 STO+ 02
130 74
131 RCL "M"
132 ×
133 STO+ 03
134 60
135 RCL "M"
136 ×
137 STO+ 04
138 RTN
139▸LBL 07
140 3
141 RCL "M"
142 ×
143 STO+ 00
144 5
145 RCL "M"
146 ×
147 STO+ 01
148 9
149 RCL "M"
150 ×
151 STO+ 02
152 113
153 RCL "M"
154 ×
155 STO+ 03
156 RCL "M"
157 STO+ 04
158 RTN
159▸LBL 08
160 54
161 RCL "M"
162 ×
163 ENTER
164 STO+ 00
165 STO+ 04
166 73
167 RCL "M"
168 ×
169 ENTER
170 ENTER
171 STO+ 01
172 STO+ 02
173 STO+ 03
174 RTN
175▸LBL 09
176 30
177 RCL "M"
178 ×
179 STO+ 00
180 41
181 RCL "M"
182 ×
183 STO+ 01
184 73
185 RCL "M"
186 ×
187 ENTER
188 STO+ 02
189 STO+ 03
190 6
191 RCL "M"
192 ×
193 STO+ 04
194 RTN
195▸LBL 00
196 62
197 RCL "M"
198 ×
199 ENTER
200 STO+ 00
201 STO+ 04
202 69
203 RCL "M"
204 ×
205 STO+ 01
206 73
207 RCL "M"
208 ×
209 STO+ 02
210 81
211 RCL "M"
212 ×
213 STO+ 03
214 RTN
215 END