Post Reply 
Displaying String on Free42 & DM42
02-04-2018, 10:30 PM (This post was last modified: 02-04-2018 10:33 PM by Bill (Smithville NJ).)
Post: #1
Displaying String on Free42 & DM42
This is a cross post that I did on the Swiss Micros Forum. I normally do not cross post, but I felt there might be some people here who might be interested in this also and who might not visit the other forum. The routines described here will also work on the Free42 but are of course limited to the smaller screen.

While the DM42 has a beautiful screen and capability to display multiple lines to it, the HP-42S programming leaves a lot to be desired in the way information can be presented to the screen.

I’ve been wondering how I was going to make use of this additional screen real estate when wawachief posted his Sudoko program demonstrating that numeric digits could be drawn on the screen. I have taken this idea further by creating some font and screen display routines.

FONTS –

Creates a 1 x 128 Matrix Table “CH” for storing the alpha characters.
Each element had the five alpha characters that are used to draw a Font Character to the screen.
Note: “CH” starts at 1 and not zero. So each Character is stored at one higher than its character code.
Label “99” is used.

DISPLAY –
Displays the Alpha Register onto the screen.
Upon entry, the Alpha Register contains the string to display and Register “P” contains a complex number which is the screen coordinate.
Labels 97 and 98 are used.
Register “00” is used for the ISG looping.
Registers 101 to 145 are used indirectly for storing the index value into the “CH” matrix array.
Note: SIZE must be set to at least 150.

I have created a sample program STRING that calls FONTS, then loops 15 times displaying the value of PI at various points on the screen.

Code:

00 { 78-Byte Prgm }
01▸LBL "STRING"
02 XEQ "FONTS"
03 2
04 STO "GrMod"
05 CLLCD
06 1.015
07 STO 01
08▸LBL 01
09 CLA
10 8
11 RCL× 01
12 7
13 -
14 ENTER
15 COMPLEX
16 STO "P"
17 "PI= "
18 RCL 01
19 2
20 ÷
21 FIX IND ST X
22 PI
23 ARCL ST X
24 XEQ "DISPLAY"
25 ISG 01
26 GTO 01
27 END

Code:

00 { 82-Byte Prgm }
01▸LBL "DISPLAY"
02 ALENG
03 X=0?
04 RTN
05 100
06 +
07 1ᴇ3
08 ÷
09 101
10 +
11 ENTER
12 STO 00
13▸LBL 97
14 ATOX
15 1
16 +
17 STO IND 00
18 R↓
19 ISG 00
20 GTO 97
21 R↓
22 STO 00
23 INDEX "CH"
24▸LBL 98
25 CLA
26 1
27 RCL IND 00
28 STOIJ
29 RCLEL
30 ARCL ST X
31 RCL "P"
32 AGRAPH
33 6
34 STO+ "P"
35 ISG 00
36 GTO 98
37 RTN
38 END


Code:

00 { 1374-Byte Prgm }
01▸LBL "FONTS"
02 1
03 128
04 NEWMAT
05 STO "CH"
06 INDEX "CH"
07 "¿¿*¿¿"
08 XEQ 99
09 ""Å¿Å""
10 XEQ 99
11 "← "
12 127
13 XTOA
14 ├"××"
15 XEQ 99
16 " @>×√"
17 XEQ 99
18 "U*U*U"
19 XEQ 99
20 "AcUIc"
21 XEQ 99
22 127
23 XTOA
24 XTOA
25 ├">Ö¿"
26 XEQ 99
27 "▒|▒|▒"
28 XEQ 99
29 "0HE@ "
30 XEQ 99
31 "PXTRQ"
32 XEQ 99
33 "→¿÷x("
34 XEQ 99
35 "QRTXP"
36 XEQ 99
37 "Å4ÖÄÅ"
38 XEQ 99
39 " p"
40 168
41 XTOA
42 ├" ?"
43 XEQ 99
44 "← ├ ←"
45 XEQ 99
46 "¿¿*Ö¿"
47 XEQ 99
48 "¿Ö*¿¿"
49 XEQ 99
50 "~  "
51 30
52 XTOA
53 ├" "
54 XEQ 99
55 "H~IA√"
56 XEQ 99
57 "÷↓[LF]↓÷"
58 XEQ 99
59 "xÄÑÄx"
60 XEQ 99
61 "|[LF]μ"}"
62 XEQ 99
63 "|°£°|"
64 XEQ 99
65 "`PXdB"
66 XEQ 99
67 ">**"÷"
68 XEQ 99
69 "~≤├IA"
70 XEQ 99
71 "`÷`÷`"
72 XEQ 99
73 "•ÑqPP"
74 XEQ 99
75 "<CBC<"
76 XEQ 99
77 "<A@A<"
78 XEQ 99
79 "U*U*U"
80 XEQ 99
81 "<<<<<"
82 XEQ 99
83 "÷÷÷÷÷"
84 XEQ 99
85 "÷÷_÷÷"
86 XEQ 99
87 "÷π÷π÷"
88 XEQ 99
89 "Å├Å├Å"
90 XEQ 99
91 "$*├*£"
92 XEQ 99
93 "#°¿db"
94 XEQ 99
95 "6IV P"
96 XEQ 99
97 "÷÷π÷÷"
98 XEQ 99
99 "÷Ö"A÷"
100 XEQ 99
101 "÷A"Ö÷"
102 XEQ 99
103 "¿*Ö*¿"
104 XEQ 99
105 "¿¿>¿¿"
106 XEQ 99
107 "÷"
108 176
109 XTOA
110 ├"p÷÷"
111 XEQ 99
112 "¿¿¿¿÷"
113 XEQ 99
114 "÷``÷÷"
115 XEQ 99
116 " ←¿▒√"
117 XEQ 99
118 ">QIE>"
119 XEQ 99
120 "÷B├@÷"
121 XEQ 99
122 "bQIIF"
123 XEQ 99
124 ""III6"
125 XEQ 99
126 "ᴇÅ£├←"
127 XEQ 99
128 "'EEE9"
129 XEQ 99
130 "<JII0"
131 XEQ 99
132 "×q≤Σ∫"
133 XEQ 99
134 "6III6"
135 XEQ 99
136 6
137 XTOA
138 ├"II)"
139 30
140 XTOA
141 XEQ 99
142 "÷66÷÷"
143 XEQ 99
144 "÷"
145 182
146 XTOA
147 ├"v÷÷"
148 XEQ 99
149 "¿Å"A÷"
150 XEQ 99
151 "ÅÅÅÅÅ"
152 XEQ 99
153 "A"Å¿÷"
154 XEQ 99
155 "√×Q≤▸"
156 XEQ 99
157 ">A]U↑"
158 XEQ 99
159 "~≤≤≤~"
160 XEQ 99
161 127
162 XTOA
163 ├"III6"
164 XEQ 99
165 ">AAA""
166 XEQ 99
167 127
168 XTOA
169 ├"AA"Ö"
170 XEQ 99
171 127
172 XTOA
173 ├"IIIA"
174 XEQ 99
175 127
176 XTOA
177 ├"≤≤≤×"
178 XEQ 99
179 ">AAQr"
180 XEQ 99
181 127
182 XTOA
183 ├"¿¿¿"
184 127
185 XTOA
186 XEQ 99
187 "÷A├A÷"
188 XEQ 99
189 "0@@@?"
190 XEQ 99
191 127
192 XTOA
193 ├"¿Å"A"
194 XEQ 99
195 127
196 XTOA
197 ├"@@@@"
198 XEQ 99
199 127
200 XTOA
201 ├"√≠√├"
202 XEQ 99
203 127
204 XTOA
205 ├"▒¿←├"
206 XEQ 99
207 ">AAA>"
208 XEQ 99
209 127
210 XTOA
211 ├"≤≤≤▸"
212 XEQ 99
213 ">AQ!↑"
214 XEQ 99
215 127
216 XTOA
217 ├"≤Æ)F"
218 XEQ 99
219 "&III2"
220 XEQ 99
221 "××├××"
222 XEQ 99
223 "?@@@?"
224 XEQ 99
225 "πᴇ`ᴇπ"
226 XEQ 99
227 127
228 XTOA
229 ├" ᴇ ├"
230 XEQ 99
231 "cÅ¿Åc"
232 XEQ 99
233 "∫▒x▒∫"
234 XEQ 99
235 "aQIEC"
236 XEQ 99
237 "÷├AA÷"
238 XEQ 99
239 "√▒¿← "
240 XEQ 99
241 "÷AA├÷"
242 XEQ 99
243 "▒√├√▒"
244 XEQ 99
245 128
246 XTOA
247 XTOA
248 XTOA
249 XTOA
250 XTOA
251 XEQ 99
252 "÷∫▒÷÷"
253 XEQ 99
254 " TTTx"
255 XEQ 99
256 127
257 XTOA
258 ├"DDD8"
259 XEQ 99
260 "8DDDD"
261 XEQ 99
262 "8DDD├"
263 XEQ 99
264 "8TTTX"
265 XEQ 99
266 "÷¿~≤√"
267 XEQ 99
268 "ᴇ"
269 164
270 XTOA
271 XTOA
272 XTOA
273 ├"x"
274 XEQ 99
275 127
276 XTOA
277 ├"▒▒▒x"
278 XEQ 99
279 "÷D}@÷"
280 XEQ 99
281 "÷@"
282 128
283 XTOA
284 132
285 XTOA
286 ├"}"
287 XEQ 99
288 127
289 XTOA
290 ├"←(D÷"
291 XEQ 99
292 "÷A├@÷"
293 XEQ 99
294 "|▒8▒|"
295 XEQ 99
296 "|▒▒▒x"
297 XEQ 99
298 "8DDD8"
299 XEQ 99
300 252
301 XTOA
302 ├"$$$ᴇ"
303 XEQ 99
304 "ᴇ$$$"
305 252
306 XTOA
307 XEQ 99
308 "|¿▒▒▒"
309 XEQ 99
310 "HTTT$"
311 XEQ 99
312 "÷▒?D "
313 XEQ 99
314 "<@@@|"
315 XEQ 99
316 "Ö @ Ö"
317 XEQ 99
318 "<@0@<"
319 XEQ 99
320 "D(←(D"
321 XEQ 99
322 "Ö   |"
323 XEQ 99
324 "DdTLD"
325 XEQ 99
326 "¿6AA÷"
327 XEQ 99
328 "÷÷├÷÷"
329 XEQ 99
330 "÷AA6¿"
331 XEQ 99
332 "¿▒¿←¿"
333 XEQ 99
334 127
335 XTOA
336 ├"¿¿¿¿"
337▸LBL 99
338 ASTO ST X
339 STOEL
340 J+
341 CLA
342 RTN
343 END


NOTE: I used the DM42 decoder/encoder page to directly edit the byte codes for where the "append" character was in the string. I may also have edited other bytes (can't remember which ones) for some of the other special characters.

Attachment includes RAW files for FONTS, DISPLAY & STRING, plus PDF of Source with comments.


.bmp  SCREEN.bmp (Size: 12.31 KB / Downloads: 128)

I would appreciate any comments, corrections, suggestions that you may have.

I would also like to thank Thomas Okken for making FREE42 and sharing the source code where I obtained the Character Code font data: bigchars.

Bill
Smithville, NJ


Attached File(s)
.zip  S.zip (Size: 307.99 KB / Downloads: 46)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Displaying String on Free42 & DM42 - Bill (Smithville NJ) - 02-04-2018 10:30 PM



User(s) browsing this thread: 1 Guest(s)