[DB50X on DM32] library programs? (*.48s)
|
11-27-2024, 01:28 PM
(This post was last modified: 11-27-2024 01:30 PM by n1msr.)
Post: #1
|
|||
|
|||
[DB50X on DM32] library programs? (*.48s)
I have not succeeded in adding a program to the library of the DB50X running on a Swiss Micros DM32. I am running the latest (v0.8.6) version of DB50X.
I could not find a demo or explicit instructions so I simply added to what is included in the release of v0.8.6 of DB50X in the Github repository. The [RPL] program is named RCH.48s (it's the HHC 2011 programming contest winner). See the listing below. When I did as described below (steps 1 and 2), I see the RCH program in the library menu under "Performance", but if I try to run it, I get this error: XlibName error: Invalid or unknown library entry 1. I edited the config/library.csv file in the "Performance" [menu] section like this: "Performance" "NQueens", "=" "SumTestWithFunction", "=" "SumTestWithLoop", "=" "Recursion", "=" "UnitsBenchmark", "=" "RCH", "=" 2. I copied RCH.48s from my PC via the USB cable to library/RCH.48s on the DM32 (where the library programs are that come with the release). Note: the program requires a string of any length, e.g. "AABBBCDEF", to run. I looked in the Help documentation on Github. There are lots of references to *library*, but I couldn't see this error or instructions on how to add to the library. Thanks to Christophe and those who have contributed to this amazing project. Program: « 0. DUP 5. SQ NDUPN 2. + ROLL DUP SIZE DUP R→I UNROT 1 SWAP START DUP NUM 61. - DUP PICK 1. + SWAP 1. - UNPICK TAIL NEXT DROP 1 1. "" NUM START UNROT SWAP R→I DUP2 - UNROT COMB ROT * NEXT + » Mark. |
|||
11-28-2024, 09:58 PM
Post: #2
|
|||
|
|||
RE: [DB50X on DM32] library programs? (*.48s)
If you store a command to the library folder, like e.g.:
Code:
a file CMD1.48s with the program code will be saved in folder library. Then you can add a new entry in Lib: Code:
It is also possible to save files in a subdirectory ("library:MyLib/CMD1"}, if this directory exists. If the command is not in the library folder or has a filename that does not correspond to the command, then you have to substitute "=" with the path (like "library:MyLib/CMD1"). All actions can be also done by creating the command file and editing the config/library.csv file directly. |
|||
11-29-2024, 12:38 PM
Post: #3
|
|||
|
|||
RE: [DB50X on DM32] library programs? (*.48s)
Thank you for your reply. At least you have confirmed that I am [trying] to do the right thing :-)
Interestingly I cannot get this to work on the DB50X (on DM32). However, it does work on the Windows simulator of DB48X (v0.8.6) running on Fedora WSL. Mark. |
|||
11-29-2024, 05:32 PM
Post: #4
|
|||
|
|||
RE: [DB50X on DM32] library programs? (*.48s)
(11-27-2024 01:28 PM)n1msr Wrote: I have not succeeded in adding a program to the library of the DB50X running on a Swiss Micros DM32. I am running the latest (v0.8.6) version of DB50X. I believe that the procedure you follow is correct, except for one current limitation of DB48x: library object caching does not detect filesystem updates. Am I correct in thinking that you did this editing without reloading / restarting DB48x? In other words, that you first used some library items and then changed the files as you described? Assuming that you saved your state or are ready to lose it, can you try going to the setup menu, then 8 (System) 2 (Enter System Menu) 4 (Reset to DMCP menu) 2 (Run Program)? Does your library element appear and run that way? If it does, then the explanation is that the ATTACH and DETACH commands are not implemented yet. For performance, when you first load or evaluate an XLIB entry, it is read from the file, compiled, and then kept in memory. That way, the next evaluation of that XLIB is as fast as if it was a stack object (and actually faster than a global variable). There is no need to read the file again or recompile. Unfortunately, DMCP as provided by SwissMicros does not have a complete filesystem implementation. You can only open one file at a time, there is no exposed API to list the files in a directory nor to get date or time attributes. As a result, there is no simple way to detect if you updated the source code. So for the moment the easiest workaround is to restart the program, which clears the cache and forces it to reload your code. In an upcoming release, I plan to use the ATTACH and DETACH RPL commands as a way to force-reload the files. On HP calculators, ATTACH attaches a library and DETACH detaches it. They both take a library numbers. The DB48x ATTACH command would force-reload from disk, and DETACH would clear the cache and free the library element's memory. DB48X,HP,me |
|||
11-29-2024, 10:20 PM
Post: #5
|
|||
|
|||
RE: [DB50X on DM32] library programs? (*.48s)
Christophe,
Thank you very much for your detailed reply. And yes, going through the SETUP options as you instructed did the trick! Appreciate the insight into ATTACH and DETACH also :-) Mark. |
|||
11-30-2024, 12:57 AM
Post: #6
|
|||
|
|||
RE: [DB50X on DM32] library programs? (*.48s)
(11-29-2024 10:20 PM)n1msr Wrote: Christophe, Actually, I implemented that tonight, so this will be in 0.8.7. Usage: - LIBS gives you the list of currently attached (i.e. cached) libraries - ATTACH pre-loads libraries - DETACH purges libraries So in your case, after changing the file, you would simply do LIBS DUP DETACH ATTACH and get your updated library value in. DB48X,HP,me |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)