Post Reply 
1,024 additional Registers on the CL
08-13-2016, 02:50 PM (This post was last modified: 08-13-2016 02:57 PM by Ángel Martin.)
Post: #38
RE: 1,024 additional Registers on the CL
(08-12-2016 09:59 PM)Gene Wrote:  How about a sorting program just to see if it all works?

Index in main ram. Index in stack. Index in extended registers.

Sort 1000 numbers. lol.

Yup, and after another long testing and debugging session... here's the deal:

1. use JM Baillard's program from http://hp41programs.yolasite.com/sorting.php

2. modify it to replace the standard functions with the extended ones - which BTW have changed names, they all have a "Y" prefix now; to make clear they are CL-specific)

3. use the program "YRAN" below to populate as many registers as you want with random numbers (assuming of course you don't want to do that manually, haha)

4. run the YSORT program, which can take a long time, then run the YVIEW program to see the sorted results...

All parameter lines are entered by the functions themselves... All everything is running with a SIZE 000 - Get psyched!!

1. View Results, bbb.eee in X

Code:

01    LBL "YVIEW"
02    LBL 00
03    "YR"
04    ARCLI
05    "|-: "
06    YRCL (IND X)
07    3075
08    ARCLX
09    AVIEW
10    PSE
11    RDN
12    ISG X
13    GTO 00
14     END

2. Populate random values: bbb.eee in X

Code:

01    LBL "YRAN"
02    RCL X
03    LBL 00
04    RNDM
05    YSTO (IND Y)
06    3074
07    RDN
08    ISG X
09    GTO 00
10    RDN
11    END

3. Sort Y-Registers, bbb.eeeii in X (mind the increment!)

Code:

01    LBL "YSORT"
02    SIGN
03    LBL 01
04    LASTX
05    LASTX
06    YRCL (IND L)
07    3076
08    LBL 02
09    YRCL (IND Y)
10    3074
11    X>Y?
12    GTO 03
13    X<>Y
14    LASTX
15    +
16    LBL 03
17    RDN
18    ISG Y
19    GTO 02
20    YX<> (IND L)
21    3076
22    YSTO (IND Z)
23    3073
24    ISG L
25    GTO 01
26    END

It's up to you to modify YSORT to use extended or standard (hybrid case) indirection ... enjoy the exercise!

"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: 1,024 additional Registers on the CL - Ángel Martin - 08-13-2016 02:50 PM



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