Post Reply 
hp 50G SysRPL linked arrays
08-08-2018, 01:55 AM
Post: #2
RE: hp 50G SysRPL linked arrays
(08-07-2018 01:32 PM)Podalirius Wrote:  Hi, I am investigating in some "Hi-End" features of System RPL.
I dont be able to find any info about linked arrays. The Programming in SysRPL second edition,
by Eduardo Kalinowski and Cardten Dominik only give very low info.
How I can find detailed info? Maybe some books?
Thank you very much for all help!!!

I'm not aware of any books describing the use of LNKARRYs, but you can find a few small bits of information in archived usenet posts from comp.sys.hp48.

The only semi-official documentation I've ever run across is the listing of the data structure in James Donnelly's "An Introduction to HP 48 System RPL and Assembly Language Programming". I believe that same structure is probably documented in a couple of other places as well. Despite searching for it, I've never run across any formal documentation pertaining to the use of these arrays.

Theoretically, they should allow faster access to specific elements for some arrays, though I've never seen any conclusive comparisons made. I would expect the biggest performance differences to occur with very large arrays and/or specially-formatted arrays created for specific purposes. Arrays of strings would probably benefit more than arrays of objects with coherent sizes, since locating the start of the string object with the included pointers should be much easier than the sequential skipping that would otherwise be required.

SysRPL compilers provide limited support for creating simple LNKARRYs, but the more complicated structures can be coded manually (using labels to facilitate the pointer creation).

As an example (using Debug4x):

LNKARRY [ % 1 % 2 % 3 ]
...creates a LNKARRY object that is similar to a UserRPL [ 1. 2. 3. ] vector, but it adds the offset pointers to the elements automatically.

To truly take advantage of the LNKARRY features, though, you probably need to be more explicit about how the array is defined. For example, if you wanted to build a 6-element LNKARRY that has 3 unique numbers each repeated twice, you could do it as follows:
   % prologue

   % size field
   GOIN5 EndOfTestLinkArray

   % object type

   % count of dimensions

   % dimension 1

   % offset 1
   GOIN5 LA_Object_3

   % offset 2
   GOIN5 LA_Object_2

   % offset 3
   GOIN5 LA_Object_1

   % offset 4
   GOIN5 LA_Object_2

   % offset 5
   GOIN5 LA_Object_1

   % offset 6
   GOIN5 LA_Object_3





   % marks the end of the object

This creates the equivalent LNKARRY for a UserRPL [ 3. 2. 1. 2. 1. 3. ].

If you look closely at how the above is defined, you'll see that the 3 raw elements are only defined once, and the offsets specify the ordering (and quantity) of the final elements in the array.

I've never seen any descriptions of which internal array functions support LNKARRYs, but I suspect most of the documented SysRPL ones do.

Hopefully others can clarify with more detail.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
hp 50G SysRPL linked arrays - Podalirius - 08-07-2018, 01:32 PM
RE: hp 50G SysRPL linked arrays - DavidM - 08-08-2018 01:55 AM
RE: hp 50G SysRPL linked arrays - DavidM - 08-08-2018, 03:07 AM

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