Random notes from HP BBS.  Author: Rick Grevelle

Commands, Functions, SYSEVALs, etc. point to RPL objects, not machine code.
What you are really seeing is the prolog (02D9D) of a RPL program object. Every
RPL routine begins with these five nibbles.  A machine code object begins with
02DCC and a five nibble length.  Note that all addresses appear in reverse
order in memory.

Regarding START, DO, IF...  the difficult task is deciphering the numerous
machine routines used internally by RPL to handle these structures. The
relatively few prefixed machine routines used to support keywords such as these
are just the tip of the iceberg as far as the internal world of RPL is
concerned.

Further, many of these are multifacited in that they will perform differently
depending on what conditions exist at the time of execution.  Take for example
the prefixed machine routine responsible for both keywords START and DO.  The
routine's address is #71A2h.  Here is an example of how this routine works.

     Used as START

     02D9D  begin RPL
     23754  list_{ 'noname 'stop }
            (these are local variables used to store the start and end of loop)
     074D0  store_local_variables
     071A2  start
     .....
     .....  (loop clause)

     2326A  next
     0312B  end RPL


     Used as DO

     02D9D  begin RPL
     071A2  do
     .....
     .....
    
     071C8  end? (requires boolean #3A81h, true; or #3AC0h, false)

Here are some other clause addresses I've currently documented in the 48:

073C3  start 0 to n-1 1short
073C3  start 1 to n-1 1short
073DB  start 1 to n-1 1short
073F7  start n2 to n1 1short2short
07221  current loop increment
07249  n of loop
07334  next
073A5  step

If you're interested in how these routines manipulate data, do what I did and
disassemble them.  If it's the keyword structures such as DO UNTIL END, START
NEXT, or IF THEN ELSE in which you're interested, store them in the top of the
RAM and PEEK at what is there.  The manner in which these are stored is fairly
straight foward; there is some nesting which occurs, but it shouldn't be any
sort of a problem for you.

Rick Grevelle
