Post Reply 
Programming Pad for RPL Programs
05-22-2014, 10:12 AM
Post: #24
RE: Programming Pad for RPL Programs
(05-22-2014 09:05 AM)Raymond Del Tondo Wrote:  
(05-22-2014 01:38 AM)Thomas Klemm Wrote:  Though I can see your point it would be tedious to reverse the stack and have it right-aligned.
The order of arguments and outputs in a stack diagram is a convention. All RPL related HP documents (manuals, external, internal) since the HP-28C use the right aligned order, and thus using this order simply avoids problems when reading stack diagrams from different sources.

Now I'm confused. This code snippet is from the source you mentioned:
Code:
    DUP ROT SWAP                        ( *A 2xDim B 2xDim* )
    ONE{}N                              ( *A 2xDim B 2xDim* )
    MATREDIM                            ( *A 2xDim B'* )

Do you agree that this stack diagram is left-aligned (linksbündig)?
And this stack diagram bellow is reversed and right-aligned:

Code:
    DUP ROT SWAP                        ( *2xDim B 2xDim A* )
    ONE{}N                              ( *2xDim B 2xDim A* )
    MATREDIM                                 ( *B' 2xDim A* )

This is the order that rprosperi prefers.

Quote:
(05-22-2014 01:38 AM)Thomas Klemm Wrote:  I think it's helpful when elements of the stack that aren't affected by a command stay at the same position.
But they don't stay at the same position. If a command takes four arguments and returns nothing, the elements above (or below) the 4 args are on top of the stack after the command.

Code:
                  ( a b c d e f )
2DROP             ( a b c d )
The top of the stack has moved from f to d, but the elements a, b, c and d stay at the same position.

Best regards
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming Pad for RPL Programs - Thomas Klemm - 05-22-2014 10:12 AM



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