Post Reply 
Valentin Albillo's "Boldly Going... Going Back to the roots" now for the HP-41 !
04-22-2024, 08:48 AM (This post was last modified: 04-22-2024 09:00 AM by Ángel Martin.)
Post: #26
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" now for the...
G'morning, with the register number changes done the execution takes just 40 seconds on V41 (using 41Z functions), or about 2 seconds in Turbo mode. Much better, saves about one minute.


Here's how the registers changed:
Code:
R25 -> R01
R01 -> R03   - ZR 01
R24 -> R02
R02 -> R05   - ZR 02
R21 -> R04
R03 -> R07   - ZR 03    
R22 -> R06
R04 -> R09   - ZR 04
R23 -> R08
R05 -> R11   - ZR 05        
R06 -> R10
R19 -> R12
R20 -> R13

And here's the new program listing:

Code:
01*LBL "RZVA"
 02 ASTO 00
 03*LBL 01
 04 ZSTO 01
 06  E-4
 07 STO 12
 08 X^2
 09 STO 13
 10 ,5
 11 STO 01
 12*LBL 02
 13 XEQ IND 00
 14 RCL 01
 15 ST/ Z
 16 /
 17 ZSTO 02
 19 RCL 12
 20 ST+ 02
 21 XEQ IND 00
 22 ZSTO 03
 24 RCL 12
 25 ST- 02
 26 ST- 02
 27 XEQ IND 00
 28 ZSTO 04
 30 ZRC+ 03
 32 ZRC- 02
 34 RCL 13
 35 ST/ Z
 36 /
 37 ZSTO 05
 39 ZRCL 03
 41 ZRC- 04
 43 RCL 12
 44 ST+ 02
 45 ST/ Z
 46 /
 47 RCL 01
 48 ST* Z
 49 *
 50 ZSTO 04
 52 ZRCL 05
 54 ZRC/ 04
 56 ZSTO 03
 58 ZRC* 02
 60 ZRC/ 04
 62 1
 63 -
 64 CHS
 65 X<>Y
 66 CHS
 67 X<>Y
 68 RCL 01
 69 Z^X
 70 1
 71 -
 72 ZRC/ 03
 74 ZST+ 01
 76 ZRC/ 01
 78 R-P
 79 RCL 13
 80 X<Y?
 81 GTO 02
 82 ZRCL 01
 84 R-P
 85 RDN
 86 STO 08
 87 SIN
 88 ABS
 89 RCL 13
 90 X<=Y?
 91 GTO 03
 92 RCL 08
 93 COS
 94 ENTER^
 95 ABS
 96 X#0?
 97 /
 98 RCL 03
 99 RCL 02
100 R-P
101 X<>Y
102 RDN
103 *
104 STO 02
105*LBL 03
106 ZRCL 01
108 ZAVIEW
109 END

See attached the RAW file in case you want to try it on your V41 environment...

It possibly can be further tweaked to squeeze a few more seconds off the timing, specially the final part - feel like taking a stab at it?

That was fun , thanks for the cues. BTW this version will go into a new module I'm putting together, credits will state "Albillo-Weber-Martin"

Cheers,
ÁM

PS. note that the "R" constant (pi in the example) now cannot be stored in R08, R09. I used PI facevalue since subtracting a real value from a complex number only involves its real part.:

01*LBL "ZZ"
02 ZRCL 01
04 ZENTER^
05 W^Z
06 PI
07 -
08 END


Attached File(s)
.zip  RZVA-V3.zip (Size: 272 bytes / Downloads: 2)

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" now for the... - Ángel Martin - 04-22-2024 08:48 AM



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