Post Reply 
Free42: advanced Copy & Paste
04-22-2017, 08:31 PM
Post: #1
Free42: advanced Copy & Paste
Hi all,

I've spent the last several weeks completely re-writing Copy and Paste in Free42. In addition to supporting full precision for scalars, it now also copies and pastes matrices as spreadsheet cells (tab-delimited text), and programs as listings.

This is fairly major new functionality, and it needs to be tested a bit more before I put it out there for general release.

If anyone is interested in taking a peek, the latest builds are at http://thomasokken.com/free42/beta/. Comments and bug reports are of course welcome, but not required. :-)

Thomas
Find all posts by this user
Quote this message in a reply
04-22-2017, 09:21 PM
Post: #2
RE: Free42: advanced Copy & Paste
Nice work!

One question. Is there no way that one can create just a .txt as program and then import it in the free42? Because using perl to create a .raw is not always possible.

In any case, very nice work.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
04-22-2017, 10:15 PM
Post: #3
RE: Free42: advanced Copy & Paste
If you have a program listing in a text file, you can open that file in a text editor, copy the program listing, and paste it into Free42. (Be sure to set it to PRGM mode before pasting.)

The idea is to make txt2raw redundant, by having its functionality integrated in Free42.

If you want to import a program listing directly, without copying & pasting, that's not supported yet, but I'll probably add that at some point in the future.
Find all posts by this user
Quote this message in a reply
04-23-2017, 02:57 PM
Post: #4
RE: Free42: advanced Copy & Paste
Hi Thomas,

Congratulations for your great job.
I've tested some copy & paste cases and was not able to find any flaw yet.
I'll study your 2.0 code, but I still have to go through 1.5.16 before.

Here are some minor suggestions:
1) Remove the current program pointer when Copying a program?
2) Currently, pasting a program erases the current program, could there be some interest inserting instead?

Best regards. Jean-Christophe
Find all posts by this user
Quote this message in a reply
04-23-2017, 04:05 PM (This post was last modified: 04-23-2017 05:03 PM by Thomas Okken.)
Post: #5
RE: Free42: advanced Copy & Paste
(04-23-2017 02:57 PM)jch Wrote:  1) Remove the current program pointer when Copying a program?
2) Currently, pasting a program erases the current program, could there be some interest inserting instead?

1) I think you're referring to the ▶ character that is inserted in front of all LBL instructions. That's authentic HP behavior, but I do think I should find a different character, or at least offer an option to leave it off, because that particular character gets interpreted as an emoji on iOS, and the result is pretty hideous. :-)
2) It doesn't erase the current program: it performs a [GTO] [.] [.] and then adds the pasted program at the end.

UPDATE: The ▶ character that gets emojified in iOS is 'BLACK RIGHT-POINTING TRIANGLE' (U+25B6); it turns out that 'BLACK RIGHT-POINTING SMALL TRIANGLE' (U+25B8), which looks like ▸, gets left alone, *and* I think it looks a lot better in program listings. I'm changing the HP<->Unicode logic in Free42 accordingly.
I am *also* updating the program listings I'm putting up at http://thomasokken.com/free42/42progs/ accordingly, and that means you won't be able to read them with the current build, because it doesn't recognize the ▸ character. Version 2.0.1 will have the fix.
Find all posts by this user
Quote this message in a reply
04-23-2017, 06:54 PM
Post: #6
RE: Free42: advanced Copy & Paste
I just posted 2.0.1.
Find all posts by this user
Quote this message in a reply
04-27-2017, 02:40 AM
Post: #7
RE: Free42: advanced Copy & Paste
(04-23-2017 06:54 PM)Thomas Okken Wrote:  I just posted 2.0.1.

Thank you very much!

Paste program test:

Code:

00 { 629-Byte Prgm }
01▸LBL "PI"
02 CLRG
03 CF 29
04 FIX 00
05 9
06 +
07 10
08 ÷
09 IP
10 2
11 ×
12 5
13 +
14 ARCL IND ST X
15 5
16 +
17 2
18 ÷
19 STO 02
20 1.07
21 ×
22 5
23 -
24 RND
25 4
26 ×
27 1
28 -
29 4ᴇ-5
30 +
31 STO 01
32▸LBL 00
33 RCL 01
34 IP
35 ENTER
36 ENTER
37 ENTER
38 4.3
39 ÷
40 IP
41 1
42 X>Y?
43 X<>Y
44 R↓
45 +/-
46 RCL 02
47 +
48 1ᴇ3
49 ÷
50 4
51 +
52 STO 00
53 STO 03
54 R↓
55 239
56 X↑2
57 ×
58 X<>Y
59 2
60 -
61 STO× ST Z
62 -
63 0
64 X<>Y
65 4
66 ×
67 XEQ 03
68 239
69 X↑2
70 X↑2
71 ENTER
72 ENTER
73 RCL 03
74 STO 00
75 CLX
76 DSE 01
77 GTO 04
78 X<>Y
79 239
80 ÷
81 X<>Y
82 XEQ 06
83 GTO 08
84▸LBL 04
85 XEQ 06
86 GTO 00
87▸LBL 02
88 1ᴇ5
89 ×
90 ENTER
91 R↑
92 STO÷ ST Z
93 MOD
94 X<>Y
95 IP
96 1ᴇ5
97 STO× ST Z
98 ×
99 X<>Y
100▸LBL 03
101 ENTER
102 R↑
103 STO÷ ST Z
104 MOD
105 LASTX
106 X<>Y
107 R↑
108 R↑
109 IP
110 +
111 1ᴇ10
112 -
113 RCL IND 00
114 +
115 X<0?
116 GTO 04
117 1
118 STO- 00
119 STO+ IND 00
120 STO+ 00
121 CLX
122 +
123 GTO 05
124▸LBL 04
125 1ᴇ10
126 +
127▸LBL 05
128 STO IND 00
129 CLX
130 +
131 ISG 00
132 GTO 02
133 RTN
134▸LBL 06
135 1ᴇ5
136 ×
137 ENTER
138 R↑
139 STO÷ ST Z
140 MOD
141 X<>Y
142 IP
143 1ᴇ5
144 X>Y?
145 GTO 07
146 ÷
147 IP
148 1
149 STO- 00
150 X<>Y
151 STO+ IND 00
152 R↓
153 STO+ 00
154 CLX
155 LASTX
156 FP
157 1ᴇ5
158 ×
159 LASTX
160▸LBL 07
161 ×
162 X<> IND 00
163 LASTX
164 ÷
165 IP
166 STO+ ST Y
167 X<> ST L
168 FP
169 X<>Y
170 1ᴇ5
171 STO× ST Z
172 ×
173 ENTER
174 R↑
175 STO÷ ST Z
176 MOD
177 LASTX
178 R↓
179 X<>Y
180 IP
181 STO+ IND 00
182 CLX
183 +
184 +
185 ISG 00
186 GTO 06
187 RTN
188▸LBL 08
189 SF 29
190 RCL 02
191 RCL 03
192 IP
193 -
194 STO+ 02
195 1.2
196 ×
197 0.9
198 -
199 RND
200 12
201 ×
202 1
203 -
204 6ᴇ-5
205 +
206 STO 01
207▸LBL 09
208 RCL 01
209 IP
210 ENTER
211 14.3
212 ÷
213 IP
214 1
215 X>Y?
216 X<>Y
217 R↓
218 +/-
219 RCL 02
220 +
221 LASTX
222 2
223 STO÷ ST Y
224 +
225 X<>Y
226 1ᴇ3
227 ÷
228 +
229 STO 00
230 STO 03
231 SF 00
232▸LBL 10
233 RCL 01
234 IP
235 ENTER
236 ENTER
237 ENTER
238 2
239 -
240 STO× ST Z
241 25
242 STO× ST Z
243 X<>Y
244 ×
245 2
246 STO- ST L
247 CLX
248 LASTX
249 STO× ST T
250 STO- ST Y
251 R↓
252 ×
253 R↑
254 STO+ ST T
255 X↑2
256 R↑
257 +
258 +
259 FS? 00
260 GTO 04
261 5ᴇ6
262 ×
263 0.75
264 GTO 05
265▸LBL 04
266 DSE 01
267 40
268 ×
269 6
270▸LBL 05
271 STO÷ ST Z
272 CLX
273 X<>Y
274 XEQ 12
275 RCL 03
276 STO 00
277 FS?C 00
278 GTO 10
279 125
280 X↑2
281 X↑2
282 ENTER
283 ENTER
284 0
285 DSE 01
286 GTO 07
287 3
288 STO× ST Z
289 STO× ST T
290 R↓
291 XEQ 06
292 GTO 13
293▸LBL 07
294 XEQ 06
295 GTO 09
296▸LBL 11
297 ENTER
298 R↑
299 STO÷ ST Z
300 MOD
301 X<>Y
302 IP
303 X<>Y
304 1ᴇ5
305 STO× ST Z
306 ×
307▸LBL 12
308 ENTER
309 R↑
310 STO÷ ST Z
311 MOD
312 X<>Y
313 LASTX
314 R↓
315 IP
316 STO+ ST Z
317 CLX
318 +
319 1ᴇ5
320 ×
321 X<>Y
322 RCL IND 00
323 -
324 X<0?
325 X>0?
326 GTO 04
327 1
328 STO- 00
329 STO- IND 00
330 STO+ 00
331 CLX
332 1ᴇ10
333 +
334▸LBL 04
335 STO IND 00
336 R↓
337 ISG 00
338 GTO 11
339 RTN
340▸LBL 13
341 RCL 03
342 FP
343 LASTX
344 IP
345 1
346 -
347 STO 00
348 1ᴇ3
349 STO× ST Z
350 ÷
351 STO 01
352 +
353 STO 03
354 CLX
355▸LBL 14
356 RCL IND 03
357 X<>Y
358 -
359 RCL IND 00
360 -
361 0
362 X<>Y
363 X<0?
364 X>0?
365 GTO 05
366 1ᴇ10
367 +
368 1
369 X<>Y
370▸LBL 05
371 STO IND 00
372 R↓
373 DSE 00
374 DSE 03
375 GTO 14
376▸LBL 01
377 RCL 01
378 4
379 +
380 STO 00
381 VIEW IND 00
382 PSE
383 ISG 00
384 FIX 05
385 BEEP
386▸LBL 15
387 RCL IND 00
388 1ᴇ5
389 ÷
390 VIEW ST X
391 ISG 00
392 GTO 15
393 RTN
394 GTO 01
395 END

That's Ron Knapp's PI program with a cleaner printout.

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 




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