newRPL - build 1255 released! [updated to 1299]
|
12-27-2019, 05:32 PM
Post: #633
|
|||
|
|||
RE: newRPL - build 1255 released! [updated to 1299]
I updated all ROMs to build 1323.
It fixes a few bugs and introduces 2 new assembly-like commands: SGET and SPUT (as in Stack GET and Stack PUT). Playing with the N-queens benchmark I realized access to the stack was always in hard-coded terms (using the pseudo registers S1..S7) and there was no indexed access to the stack. SGET/SPUT use the stack as a vector of objects: SGET.lvl --> Reads the stack at level lvl, where 'lvl' can be a register, a literal or a stack reference to an index number. SPUT.lvl.A --> Stores A into stack level 'lvl'. Both A and 'lvl' can be anything. With these 2 commands, indirect access to the stack is provided. I used it to code one more example: Code:
The code above is the N-queens benchmark, verbatim translation of the Pascal sample code. Interestingly enough (and sort-of expected), the RPL solution using stackrobatics is slightly faster than this one (106 ms vs. 114 ms). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)