HP50G - Library ROMID question
|
07-01-2019, 12:08 PM
Post: #1
|
|||
|
|||
HP50G - Library ROMID question
If a library is on level 1 of the stack is there any SYSRPL command or routine that will give the ROMID number of the library
Thanks Jeff |
|||
07-01-2019, 03:59 PM
Post: #2
|
|||
|
|||
RE: HP50G - Library ROMID question
Here's a really fugly brute-force way to it in User RPL. The first literal string is a single space.
<< ->STR DUP " " POS 1 + OVER ":" POS 1 - SUB OBJ-> >> This might not work on unnamed libraries (I didn't check), in which case the ":" POS should be modified as needed. <0|ΙΈ|0> -Joe- |
|||
07-01-2019, 08:43 PM
Post: #3
|
|||
|
|||
RE: HP50G - Library ROMID question
Hi Joe
I see what you have done I'm doing my own simple Lib ATTACH/PURGE program. This will save having to input the ROMID Thanks Jeff |
|||
07-01-2019, 09:29 PM
Post: #4
|
|||
|
|||
RE: HP50G - Library ROMID question
The below version is definitely overkill for an application like this, and is almost twice the size of Joe's excellent (definitely not fugly) program. But since I know you (Jeff) are experimenting with SysRPL/Saturn/Debug4x right now, I thought I'd show an example that uses a SysRPL wrapper around a Saturn code object to directly extract the number from the library on the stack. The exact location of the library number is dependent on the length of the library title, so the program has to assess the title field before extracting it:
Code: RPL It shows several techniques that are common to this type of coding, including: - checking the stack for appropriate arguments - allocating memory for results prior to executing a Saturn code object - use of MASD skip structure for conditional execution - simple stack manipulation in Saturn code |
|||
07-01-2019, 11:01 PM
Post: #5
|
|||
|
|||
RE: HP50G - Library ROMID question
(07-01-2019 03:59 PM)Joe Horn Wrote: Here's a really fugly brute-force way to it in User RPL. The first literal string is a single space. Clever! and not fugly at all, in fact, it's darned elegant, as long as the library is not too big... I was looking at your FININVARS program and the program for identifying libraries used in a given program for hints but was not sure of the exact format of a library object. Where is that documented, other than in the heads of you guys that think in RPL? --Bob Prosperi |
|||
07-02-2019, 02:36 AM
Post: #6
|
|||
|
|||
RE: HP50G - Library ROMID question
(07-01-2019 11:01 PM)rprosperi Wrote: ...but was not sure of the exact format of a library object. Where is that documented, other than in the heads of you guys that think in RPL? I usually go to the "Introduction to Saturn Assembly Language" book from Gilbert Fernandes (Edited and Maintained by Eric Rechlin) when trying to discern RPL object structures. If that fails, I make some examples on the emulator and alter them to see what happens. For something like a library, it must have taken a lot of trial-and-error testing to reverse engineer the format. There's quite a bit in library objects. |
|||
07-02-2019, 03:24 AM
Post: #7
|
|||
|
|||
RE: HP50G - Library ROMID question
(07-02-2019 02:36 AM)DavidM Wrote:(07-01-2019 11:01 PM)rprosperi Wrote: ...but was not sure of the exact format of a library object. Where is that documented, other than in the heads of you guys that think in RPL? Thanks David, and of course thank you Joe. LOL, the laugh's on me. After examining the format in confusion for a while, comparing Joe's code, I finally see that he's simply grabbing it from the title; I thought he was converting the entire library to a string and then parsing through that to find the ID following the name. And of course, this solution is even more innovative than I thought as it demonstrates the non-obvious but simple idea to just use the name as shown. Sure, math is interesting, but puzzles like this are far more interesting to me. Also, thanks David for sharing your nicely documented SysRPL/Saturn routine (which actually does what I thought Joe was doing). I've long since given up on any chance of learning Saturn coding, but more samples like this along the way would have helped a lot. Saturn code always made more sense for 71B code for me than for 48/49/50 code, likely due to the more linear flow in the 71 vs RPL structures. --Bob Prosperi |
|||
07-02-2019, 10:46 AM
Post: #8
|
|||
|
|||
RE: HP50G - Library ROMID question
Hi David
For now my comfort zone is RPL and Joe's program is easy for me to understand. I will cut and paste your ASM code into Debug4 and experiment with it. Although I'm not fully with your code I can see overall what its doing. I have also looked at the library object structure on page 126 of Introduction to Saturn Assembly Language. All very interesting Very much appreciated David - gives me plenty to think about Jeff |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)