Post Reply 
Somebody having a clever substitute for the CLRGX command?
09-30-2024, 10:08 AM (This post was last modified: 09-30-2024 10:28 AM by emefff.)
Post: #6
RE: Somebody having a clever substitute for the CLRGX command?
Oh that was quick, I think I got it:

Code:
01 LBL CLRGX2   # substitute for CLRGX on non-CX HP41s
02 FIX 5
03 STO 30     # bbb.eeeii in X, STO this in reg 30, a lot of registers may be in the way in the lower region, set SIZE 35 minimal
04 XEQ INT
05 STO 31     # bbb integer part in reg 31
06 RCL 30
07 RCL 31
08 -
09 100000
10 *
11 STO 32     # stuff after comma to reg 32 in the form eeeii not 0.eeeiii, leading 0 disappears!
12 100
13 /
14 XEQ INT
15 STO 33     # eee in reg 33
16 RCL 32
17 RCL 33
18 100
19 *
20 -
21 STO 34     # ii in reg 34 # reg 31 will be the counter in the loop, the first reg to delete
22 X=0?
23 1
24 STO 34     # if ii = 0 it means it is not set, then every reg is to be deleted! therefore we must set ii = 1 
25 LBL 01     # loop starts here
26 0
27 STO IND 31     # store 0 in the register stored in reg 31
28 RCL 33     # eee in X
29 RCL 31     # bbb in x, eee in Y
30 RCL 34     # ii in X, bbb in Y, eee in Z
31 +          # bbb+ii in X, eee in Y
32 STO 31     # bbb+ii in X, this is our counter
33 X<=Y?
34 GTO 01
35 FIX 9
36 END

Thank you Werner, I will try yours as well. My code doesn't check anything LOL. We are using the same amount of lines, VERY interesting! :-)

emefff.

[35, 45, 41CV, 41CX, 12c, 15c, 15CE, 28S, 42s, 48GX, DM15L, DM42, DM41X, wp34s, wp34s_on_DM42, 35S, Prime, IVEE]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Somebody having a clever substitute for the CLRGX command? - emefff - 09-30-2024 10:08 AM



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