Post Reply 
1,024 additional Registers on the CL
08-10-2016, 01:23 PM (This post was last modified: 08-10-2016 01:32 PM by Ángel Martin.)
Post: #21
RE: 1,024 additional Registers on the CL
(08-08-2016 02:18 PM)Ángel Martin Wrote:  Mission accomplished... all working as intended.

the only limitation is Stack arguments for the Indirect case (since obviously the direct case is the same as for the native functions) - and perhaps a XVIEW _ _ _, but there's no more room available for more code.

That limitation really bothered me, very relevant for ISG loops using the stack - so I've gone the extra mile and implemented the IND ST combination as well. The mask is 2,048, to be added to the actual register number, i.e. IND_X = 2051; IND_Y = 2052, etc. The range is from IND_T up to IND_e - yes, including {M,N,O,P,Q,K,a,b,c,d,e}.

Also fixed some weird issues due to flag incompatibilities in a running program that uses AVIEW, VIEW or AON instructions - those pesky system flags again...

Here's a quick test routine for the beta testers:

put in X the control word of extended registers you want to visualize, bbb.eee
run the routine below to visualize those values sequentially:

LBL "XVIEW"
LBL 00
"XR" (alpha text)
ARCLI (from the OSX3 module)
XRCL
2051 (IND X)
"|-: " (append, colon, blank)
ARCLX
AVIEW
PSE
RDN
ISG X
GTO 00
END
Find all posts by this user
Quote this message in a reply
08-11-2016, 06:33 AM (This post was last modified: 08-11-2016 06:34 AM by Ángel Martin.)
Post: #22
RE: 1,024 additional Registers on the CL
ok folks, last one on this saga - just to mention that I've added XVIEW _ _ _ to the code, thus the function set is pretty complete.

Of course it'll be also great to have XISG / XDSE... doable but would need to lose the FOCAL programs to make room.\

and how about a hybrid indirect addressing, whereby the IND points at the STANDARD registers instead?

XRCL IND RG _ _ oh my....
Find all posts by this user
Quote this message in a reply
08-11-2016, 04:10 PM
Post: #23
RE: 1,024 additional Registers on the CL
I agree. I think this would be VERY useful. Using a standard register to indirectly point to these 1024 registers...yes.
Find all posts by this user
Quote this message in a reply
08-11-2016, 05:35 PM (This post was last modified: 08-11-2016 05:36 PM by Ángel Martin.)
Post: #24
RE: 1,024 additional Registers on the CL
you guys are insatiable... this is getting very tricky, the code is looking amazing so far... I just completed XISG _ _ _ and XDSE _ _ _ so with that rich function set migrating programs should be getting close to becoming a breeze...

I have an idea to get it done but for program operation the "mask" will need to be stratospheric, i.e. add 3,072 (0xC00) to the index:

expanded: from 400 to 3FF - normal index#
IND "expanded": = adds 1,024 to index
IND ST (1-16): adds 2,048 to st_index
IND ST (standard) regs, per current SIZE): adds 3,072 to index

debugging is very tedious, can't use V41 or other PC tools... it's hard work but when completed (and we're 95% there) I trust this should give a nice boost to the CL world.
Find all posts by this user
Quote this message in a reply
08-11-2016, 05:42 PM (This post was last modified: 08-11-2016 05:47 PM by Ángel Martin.)
Post: #25
RE: 1,024 additional Registers on the CL
here's a design question for you :

which hot key to use for the IND RG _ _ prompt?

- SHIFT triggers IND
- SHIFT, RADIX trigers IND ST _
- SHIFT, [??] triggers IND RG _ _


EEX is already used for the thousands' field
Math keys are already used for the arithmetic fncs.
two top rows are used for shortcuts 1-10
RCL/STO/SST/RS are used to toggle between functions

so available still are: XEQ, CHS, ENTER, USER, PRGM, ALPHA

of course we can use repeats, say the radix key pressed twice... ( I fancy this one, it can be used as a toggle to move between stack and standard regs for indirect addressing... the more I think about it the more I like it)


And the winner is....
Find all posts by this user
Quote this message in a reply
08-11-2016, 06:10 PM
Post: #26
RE: 1,024 additional Registers on the CL
Eh, I kinda like the ENTER, but I'm ok with CHS, etc.
Find all posts by this user
Quote this message in a reply
08-11-2016, 10:15 PM
Post: #27
RE: 1,024 additional Registers on the CL
(08-11-2016 05:42 PM)Ángel Martin Wrote:  of course we can use repeats, say the radix key pressed twice... ( I fancy this one, it can be used as a toggle to move between stack and standard regs for indirect addressing... the more I think about it the more I like it)

Hitting the radix multiple times as a toggle is nice if the prompts change with each press of the radix.

To be clear, I mean [STO] [Shift] [Radix] would display STO IND ST _ _
and on the next press of [Radix] display would change to STO IND RG _ _
and another press of [Radix], it would change back to STO IND ST _ _
and so on.

I think this is more intuitive than any of the other available keys. Gene?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-12-2016, 04:39 AM
Post: #28
RE: 1,024 additional Registers on the CL
(08-11-2016 10:15 PM)rprosperi Wrote:  To be clear, I mean [STO] [Shift] [Radix] would display STO IND ST _
and on the next press of [Radix] display would change to STO IND RG _ _
and another press of [Radix], it would change back to STO IND ST _

Exactly - only the ST prompt is one field long as shown above.
This is the most difficult option to program (logic and all) but I think it's the best U/I so I'll give it a try...
Find all posts by this user
Quote this message in a reply
08-12-2016, 02:57 PM (This post was last modified: 08-12-2016 06:45 PM by Ángel Martin.)
Post: #29
RE: 1,024 additional Registers on the CL
Well, full success - and then some more: not only I managed to implement the hybrid indirection in all its glory, but I also figured out a way to fully automate the parameter entry in program mode !

Say you want to use the contents of the extended register R"23 (somewhere within RAM block 801) , then just type
XSTO" IND 23 in program mode, then the following two lines are added by the function:

01 XSTO
02 1047

or say you want to use the stack register N as source instead: XSTO' IND ST "N" (the prompt supports synthetic arguments):

03 XSTO
04 2054

or going hybrid, say you want to use the contents or the (standard) R23 instead (somewhere in the main RAM, depending of your SIZE setting):
XSTO" IND RG 23, which creates the following two lines for you:

05 XSTO
06 3095

There you have it, no need to manually edit the parameter - an absolute beauty if you ask me!!!

now I can't stop entering random values to watch the show ;-)

Extended Storage Function Set:

CLXRG
XDSE
XISG
XRCL
XRC+
XRC-
XRC*
XRC/
XSTO
XST+
XST-
XST*
XST/
XVEW
XX<>
Find all posts by this user
Quote this message in a reply
08-12-2016, 03:33 PM
Post: #30
RE: 1,024 additional Registers on the CL
Fabulous!
Find all posts by this user
Quote this message in a reply
08-12-2016, 06:08 PM
Post: #31
RE: 1,024 additional Registers on the CL
Marvelous!
Find all posts by this user
Quote this message in a reply
08-12-2016, 07:44 PM
Post: #32
RE: 1,024 additional Registers on the CL
[Image: ykdngz.jpg]

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
08-12-2016, 09:13 PM
Post: #33
RE: 1,024 additional Registers on the CL
Simply beautiful!
Find all posts by this user
Quote this message in a reply
08-12-2016, 09:58 PM (This post was last modified: 08-12-2016 10:00 PM by Ángel Martin.)
Post: #34
RE: 1,024 additional Registers on the CL
thanks folks, such praising makes the effort well worth it...

Basic testing of all functions is finally complete; next is to put them to work in a real example and see how it holds up. How about that 20x20 determinant Gene?

Pity the advantage/SandMatrix functions are not capable to access the new registers, so it'll have to be a good 'ol FOCAL code (only running at 50x turbo of course)

Anyone has a suggestion of a program to use as testing bench?
Find all posts by this user
Quote this message in a reply
08-12-2016, 09:59 PM
Post: #35
RE: 1,024 additional Registers on the CL
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.
Find all posts by this user
Quote this message in a reply
08-12-2016, 10:05 PM
Post: #36
RE: 1,024 additional Registers on the CL
Friggin amazing!

Which module will this new functionality be in? A new update to the CL Expanded Memory ROM?

You never cease to amaze Angel!

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
08-13-2016, 02:31 PM (This post was last modified: 08-13-2016 02:55 PM by Ángel Martin.)
Post: #37
RE: 1,024 additional Registers on the CL
(08-12-2016 10:05 PM)rprosperi Wrote:  Which module will this new functionality be in? A new update to the CL Expanded Memory ROM?

Yes, and that was also a compounding issue: all the FOCAL and MCODE functions related to the same subject had to stay, so space was very tight.
Find all posts by this user
Quote this message in a reply
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!
Find all posts by this user
Quote this message in a reply
08-13-2016, 04:04 PM
Post: #39
RE: 1,024 additional Registers on the CL
So here's a challenge.

Fastest sort routine to handle 1000 random values.

Wonder how S3 from the PPC rom would do modified to use these new functions? It was awfully quick for a focal routine.
Find all posts by this user
Quote this message in a reply
08-14-2016, 07:03 AM (This post was last modified: 08-14-2016 07:13 AM by Ángel Martin.)
Post: #40
RE: 1,024 additional Registers on the CL
(08-13-2016 04:04 PM)Gene Wrote:  So here's a challenge.
Fastest sort routine to handle 1000 random values.

Wonder how S3 from the PPC rom would do modified to use these new functions? It was awfully quick for a focal routine.

Not much of a challenge anymore, it was very easy to modify the S2/S3 routines in those steps involving IND registers manipulation; piece of cake.

The only precaution was that register P(8) is also used by the functions, so I replaced that in the S2 routine with the (standard) R00 register.

The execution times are amazing, even for large sets: In TURBO 50 and with a frozen ALPHA message (to avoid the goose) it cruised thru a 102 register set in 7.5 seconds , and did the 1,000 register block in a little more than 32 sec. I had previously populated the set with random values using the YRAN program above.

So i declare the module complete, and ready for prime time!
Find all posts by this user
Quote this message in a reply
Post Reply 




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