Post Reply 
newRPL: [UPDATED April 27-2017] Firmware for testing available for download
01-23-2017, 10:44 PM
Post: #525
RE: newRPL: [UPDATED December-29-16] Firmware for testing available for download
(01-23-2017 07:19 PM)The Shadow Wrote:  newRPL STREAM behaves very differently from RPL STREAM. Which isn't bad in itself, but it does seem less flexible.

RPL STREAM puts the first two elements of the list on the stack, then runs the program. Then the next element, and runs the program; and so on until the list is done. The rest of the stack is still available - you can do PICK3 for example to use a constant elsewhere on the stack.

newRPL STREAM seems confined to the elements of the list; trying to access the rest of the stack returns 'Bad argument count' errors.
There is indeed a stack protection that prevents you from accessing the stack outside of the list you are processing.
Error handling seems broken, as it doesn't show the proper message. I will investigate.

(01-23-2017 07:19 PM)The Shadow Wrote:  A more serious issue is that when I tried to get around that problem by using local variables instead, that also returned errors. The program used in STREAM doesn't seem to allow the use of local variables at all - an 'Exception: Data abort' is thrown and the program ends up on the stack with local variables replaced by 'INVALID_COMMAND'.

I believe you hit a bug in the optimizer of the compiler. The problem happens because you declare a local variable with LSTO, and then the compiler "optimized away" the variable the next time you used it with direct GETLAM style opcodes (which are decompiled as "INVALID_COMMAND" as there's no user-visible text to decode these instructions, so that's normal). However, the optimizer is not supposed to go across << >> symbols, since this is code that will be stored in the stack to be executed separately when the local variable may or may not exist, hence it should be called by name, not optimized.
One more thing to investigate and fix. This was working fine, not sure at what point I broke it again...
An update will be coming in the next week or so with all these fixes. Thanks for testing and reporting!
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: newRPL: [UPDATED December-29-16] Firmware for testing available for download - Claudio L. - 01-23-2017 10:44 PM

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