HP-41 X-Mem (e)TWIN module
05-11-2022, 12:58 PM (This post was last modified: 06-08-2022 02:30 PM by Ángel Martin.)
Post: #1
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
HP-41 X-Mem (e)TWIN module
Greetings fellow enthusiasts,

If you ever had questions about the hp-41 X-Mem design and implementation, perhaps wishing that HP had done something *different* (and this is not implying that the actual model is a bad one), then you may enjoy the chance to travel "the path not taken", playing around with this new module/

Meet the XMem-(e)TWIN module, where the "e" in this case stands for both electronic and evil - Why evil, you ask? Because those void memory segments in-between X-Mem modules certainly deserve such a moniker; a real struggle to manage in the MCODE and a waste of available space (what were they thinking?) -- but let's not digress...

The XMEM_TWIN module provides a complete set of functions targeted to the X-Registers that make the Extended memory area. Within X-Mem there are 606 X-Registers that can now be accessed individually using X-versions of (A)RCL, (A)STO, X<>, ISG, DSE, VIEW, etc., fully supporting direct and indirect addressing, for the three ranges of data sources: Stack Registers, "regular" Data registers, and X-Registers.

Obviously once you get into this path there's no use for any of the "official" X-Mem functions, so this is an either/or choice. But it's totally "reversible" (for the lack of a better word), simply use CLXM to start over from a clean slate using the orthodox way.

Remember: X-Mem files will not survive the use of the X-Regs functions!

The module also includes a large set of application routines all based on the PPC classic programs for sorting, matrices and block handling. Basically they are the same routines, only using X-Registers instead of the "regular" ones (sic.)

Reasonable amount of testing has been done but this is never enough (remember those memory voids, always lurking in the dark?) - so be careful and DO NOT use it if you don't have a backup. Use it at your own risk, as they say.

Hope you enjoy playing with this evil twin, and as usual feedback is always welcome.

Cheers,
ÁM

P.S.- The Library#4 is required, also included in the attached ZIP container.

PSS. New version attached, it corrects a minor bug in the ST/RG U/I.

PPSS.- Function list:
Code:
--XROM----ADDR--FUNCTION --------------  020.00   AF6F  -XMEM_TWIN  MCode XROM 20.00  "-XMEM TWIN"  020.01   A784  TF#         MCode XROM 20.01  "TF#"  020.02   A7BB  TF$MCode XROM 20.02 "TF$"  020.03   A9EE  A<>XRG      MCode XROM 20.03  "A<>XRG"  020.04   A48B  CLXRG       MCode XROM 20.04  "CLXRG"  020.05   A9A5  CLXRGX      MCode XROM 20.05  "CLXRGX"  020.06   A874  CPYBNK      MCode XROM 20.06  "CPYBNK"  020.07   A852  STKSWP      MCode XROM 20.07  "STKSWP"  020.08   A9F7  ST<>XRG     MCode XROM 20.08  "ST<>XRG"  020.09   A08A  XFINDX      MCode XROM 20.09  "XFINDX"  020.10   A93D  XRGMOV      MCode XROM 20.10  "XRGMOV"  020.11   A945  XRGSWP      MCode XROM 20.11  "XRGSWP"  020.12   AF64  -X-REGS_FNS MCode XROM 20.12  "-X-REGS FNS"  020.13   ABBA  XARC        MCode XROM 20.13  "XARC"  020.14   ABC2  XAST        MCode XROM 20.14  "XAST"  020.15   ABEF  XDSE        MCode XROM 20.15  "XDSE"  020.16   ABF9  XISG        MCode XROM 20.16  "XISG"  020.17   ABCA  XRCL        MCode XROM 20.17  "XRCL"  020.18   AB82  XRC+        MCode XROM 20.18  "XRC+"  020.19   AB89  XRC-        MCode XROM 20.19  "XRC-"  020.20   AB90  XRC*        MCode XROM 20.20  "XRC*"  020.21   AB97  XRC/        MCode XROM 20.21  "XRC/"  020.22   ABD3  XSTO        MCode XROM 20.22  "XSTO"  020.23   AB9E  XST+        MCode XROM 20.23  "XST+"  020.24   ABA5  XST-        MCode XROM 20.24  "XST-"  020.25   ABAC  XST*        MCode XROM 20.25  "XST*"  020.26   ABB3  XST/        MCode XROM 20.26  "XST/"  020.27   ABE5  XVEW        MCode XROM 20.27  "XVEW"  020.28   ABDC  XX<>        MCode XROM 20.28  "XX<>"  020.29   AEBC  -XREGS_APPS MCode XROM 20.29  "-XREGS APPS"  020.30   A7D4  LSTF        MCode XROM 20.30  "LSTF"  020.31   AE56  "XDUMP"     UCode XROM 20.31  "XDUMP"  020.32   AE21  "XINP"      UCode XROM 20.32  "XINP"  020.33   ADFF  "XOUT"      UCode XROM 20.33  "XOUT"  020.34   ADE0  "XRAN"      UCode XROM 20.34  "XRAN"  020.35   AE66  "XSHFT"     UCode XROM 20.35  "XSHFT"  020.36   ADA6  "XSORT"     UCode XROM 20.36  "XSORT"  020.37   AEA4  -XPPC_MTRX  MCode XROM 20.37  "-XPPC MTRX"  020.38   A696  "QR"        UCode XROM 20.38  "QR"  020.39   AD17  "XMIO"      UCode XROM 20.39  "XMIO"  020.40   A356  "XRRM"      UCode XROM 20.40  "XRRM"  020.41   A11A  "XM1"       UCode XROM 20.41  "XM1"  020.42   A0D7  "XM2"       UCode XROM 20.42  "XM2"  020.43   A0EE  "XM3"       UCode XROM 20.43  "XM3"  020.44   A15C  "XM4"       UCode XROM 20.44  "XM4"  020.45   A16F  "XM5"       UCode XROM 20.45  "XM5"  020.46   A4E2  "XS1"       UCode XROM 20.46  "XS1"  020.47   A5C0  "XS2"       UCode XROM 20.47  "XS2"  020.48   A50F  "XS3"       UCode XROM 20.48  "XS3"  020.49   AEAF  -XPPC_BLCK  MCode XROM 20.49  "-XPPC BLCK"  020.50   A28A  "XBC"       UCode XROM 20.50  "XBC"  020.51   A128  "XBE"       UCode XROM 20.51  "XBE"  020.52   A2DA  "XBI"       UCode XROM 20.52  "XBI"  020.53   A1B6  "XBM"       UCode XROM 20.53  "XBM"  020.54   A1E6  "XBR"       UCode XROM 20.54  "XBR"  020.55   A659  "XBV"       UCode XROM 20.55  "XBV"  020.56   A26A  "XB?"       UCode XROM 20.56  "XB?"  020.57   A223  "XBX"       UCode XROM 20.57  "XBX"  020.58   A1A6  "XDR"       UCode XROM 20.58  "XDR"  020.59   A194  "XIR"       UCode XROM 20.59  "XIR"  020.60   A2F0  "XMS"       UCode XROM 20.60  "XMS"  020.61   A2B9  "XPR"       UCode XROM 20.61  "XPR"  020.62   A322  "XSM"       UCode XROM 20.62  "XSM"  020.63   A29F  "XUR"       UCode XROM 20.63  "XUR"
05-12-2022, 12:03 PM
Post: #2
 J-F Garnier Senior Member Posts: 699 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
(05-11-2022 12:58 PM)Ángel Martin Wrote:  The XMEM_TWIN module provides a complete set of functions targeted to the X-Registers that make the Extended memory area.

Obviously once you get into this path there's no use for any of the "official" X-Mem functions, so this is an either/or choice.

Remember: X-Mem files will not survive the use of the X-Regs functions!

The loss of the rest of the X-MEM file functions is a real limitation, especially the ability that I've been using a lot in the past to save/restore a program to X-MEM.
Maybe a possible mitigation would be to use a regular X-M DATA file with all your new functions accessing it. This would be much more flexible than the SEEKPT, GETX/SAVEX sequence, and the user would be able to dedicate part or all of the X-MEM for this purpose.

J-F
05-13-2022, 06:05 AM
Post: #3
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
(05-12-2022 12:03 PM)J-F Garnier Wrote:
(05-11-2022 12:58 PM)Ángel Martin Wrote:  The XMEM_TWIN module provides a complete set of functions targeted to the X-Registers that make the Extended memory area.
Obviously once you get into this path there's no use for any of the "official" X-Mem functions, so this is an either/or choice.
Remember: X-Mem files will not survive the use of the X-Regs functions!

The loss of the rest of the X-MEM file functions is a real limitation, especially the ability that I've been using a lot in the past to save/restore a program to X-MEM.
Maybe a possible mitigation would be to use a regular X-M DATA file with all your new functions accessing it. This would be much more flexible than the SEEKPT, GETX/SAVEX sequence, and the user would be able to dedicate part or all of the X-MEM for this purpose.

Thanks for chiming in J-F.
I see what you're suggesting and it's a "compromise" for backwards compatibility; so I'll think about it. So far I wanted to have a separate environment, so to me it is not about mitigation since the goal was never to be compatible with the classic approach. I'll give it a thought, anyway.

Cheers,
ÁM
05-21-2022, 12:32 AM
Post: #4
 Gene Moderator Posts: 1,286 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
Angel,

Great work as always. These are so easy to use.

I did some timing to sort a large set of numbers using XS2... random integers between 0 and 999. they were stored starting in X-reg 10 and up.

100 numbers was 35 seconds.
200 numbers was 120 second.

However, I could not get XS3 to work. It ran and ran but did not stop. Might be a bug in there. :-)

Don't know where.
05-24-2022, 10:36 AM
Post: #5
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
(05-21-2022 12:32 AM)Gene Wrote:  ... However, I could not get XS3 to work. It ran and ran but did not stop. Might be a bug in there. :-)

Good catch, I found the issue - the wrong function id# was called in the routine.
I'm making the changes now but I'm not sure about keeping the FOCAL routines in the same ROM file, maybe they should reside in a separate "APPS" companion ROM?
05-24-2022, 11:27 AM
Post: #6
 Gene Moderator Posts: 1,286 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
My preference would be to keep them in the same rom, unless there isn't room.

Takes up fewer ports, which is a problem even in our virtual bank-switching days. :-)

These are so easy to use and so similar (now) in functionality to regular data registers, what there are times SIZE 000 would be fine if these were used.
05-25-2022, 01:43 PM
Post: #7
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
I hear you, makes sense to have the tools and the apps together but the problem arises when there are too many apps to fit in a single ROM page.

Case in point: my initial idea here was mimicking the Y-REGS APPS module, which includes both the PPC-based routines and the Matrix routines. To me that's a sound approach as well, keeping things apart to get the space and keep things neatly sorted.

Since there was plenty of available room in the "tools" ROM I put the PPC routines and the X-REGS functions together. This misses out the Matrix functions, so not perfect. Obviously this can be easily "fixed" with a companion ROM with the missing Matrix apps; problem is there aren't that many of them to fill it up so we're back to square one...

Mulling it over as I write this...
05-25-2022, 11:04 PM
Post: #8
 Gene Moderator Posts: 1,286 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
I didn't notice much of anything missing from the XMEM Twin rom. It had the new X-memory register functions and the PPC functions too.

It is all in a 4k rom so what doesn't fit in it?

:-)

Gene
05-26-2022, 01:50 AM
Post: #9
 Gene Moderator Posts: 1,286 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
Or, at least :-) fix the XS3 bug and reissue the rom as you originally published it. haha.
06-01-2022, 09:09 AM
Post: #10
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
(05-26-2022 01:50 AM)Gene Wrote:  Or, at least :-) fix the XS3 bug and reissue the rom as you originally published it. haha.

here it is, let me know if you find issues.

Attached File(s)
06-08-2022, 02:29 PM (This post was last modified: 06-09-2022 12:00 PM by Ángel Martin.)
Post: #11
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
Announcing New TWIN Modules/

Following on JF's request to have an "in-file" implementation of the File Record X-Functions, I've added a parallel set of STO/RCL functions to address his request.

Like the X-Set, the new F-Set supports math operations and allows for all possible direct and indirect addressing; so both sets are completely equivalent in everything except in their "domains":

- The X-Set operates on the X-Mem as a whole
- The F-set operates on the Data File whose name is in ALPHA

As a consequence of this, the XPPC APPS routines are now moved to its own ROM (sorry Gene). The good news is there are now two sets of PPC APPS, one using the X-Set (the XPPC APPS) and the other using the F-Set (the FPPC APPS).

Moreover, the X-Matrix APPS are in its own ROM - which I have completed by adding more programs from JM Baillard's excellent collection on the subject.

So we're down to three ROMs so far, are we? Well, not quite...
Introducing the other X-MEM TWIN module - and this one with a "classic" scope within the standard X-Mem functionality: basically it's a compilation of additional functions from several other modules, plus Doug Wilder's LIFO File implementation.

Thus FOUR ROMS in total all around the X-MEM subject; two TWINS and Two APPS ROMS as examples for the X- and F-Sets.

Have fun!

Attached File(s)
06-08-2022, 10:33 PM
Post: #12
 Gene Moderator Posts: 1,286 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
Ha. That's ok. Keep the previous version of the module handy for those who want an all-in-one without the regular X-memory file functions. :-)
06-08-2022, 10:59 PM
Post: #13
 rprosperi Super Moderator Posts: 5,436 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
Angel, do you take time out to breath and eat?

Reorganizing/restructuring all these Fns into 4 modules is amazing, plus more of your beautiful manuals too!

Small suggestion: The 1-page chart you created years ago that shows the various types of 41 memory and which key Fns are used to access them is something I reference all the time, there's just too many modules, commands, etc. to try to keep it all in mind.

It would likely be useful for a similar chart/map that explains which modules/command sets are applicable for managing memory in the alternate ways (data registers vs. files). From a very quick peek at the manuals, it appears the commands may have synchronized names, which might make this chart easier to make/use, but I've not used this at all yet, so possibly that's not fully correct.

Thanks for sharing this stuff, who coulda guessed 41 software would continue getting more interesting this many years later?!?!

--Bob Prosperi
06-09-2022, 01:43 AM
Post: #14
 Gene Moderator Posts: 1,286 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
And of course, with a 41CL or DM-41X, the extra module or not does not matter at all... simply unplug and plug!
06-09-2022, 12:02 PM
Post: #15
 Ángel Martin Senior Member Posts: 1,368 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
(06-08-2022 10:59 PM)rprosperi Wrote:  It would likely be useful for a similar chart/map that explains which modules/command sets are applicable for managing memory in the alternate ways (data registers vs. files). From a very quick peek at the manuals, it appears the commands may have synchronized names, which might make this chart easier to make/use, but I've not used this at all yet, so possibly that's not fully correct.

Take a look at the graphic in page #32 in the updated manual ...
06-09-2022, 06:04 PM (This post was last modified: 06-09-2022 06:06 PM by rprosperi.)
Post: #16
 rprosperi Super Moderator Posts: 5,436 Joined: Dec 2013
RE: HP-41 X-Mem (e)TWIN module
(06-09-2022 12:02 PM)Ángel Martin Wrote:
(06-08-2022 10:59 PM)rprosperi Wrote:  It would likely be useful for a similar chart/map that explains which modules/command sets are applicable for managing memory in the alternate ways (data registers vs. files). From a very quick peek at the manuals, it appears the commands may have synchronized names, which might make this chart easier to make/use, but I've not used this at all yet, so possibly that's not fully correct.

Take a look at the graphic in page #32 in the updated manual ...

Nearly exactly what I had in mind; one might have guessed I would have seen that with the bright colors, but missed it when I skimmed.

Angel, you remain "The Man!"

Thanks!

--Bob Prosperi
 « Next Oldest | Next Newest »

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