Post Reply 
Can 50g sysRPL jump to lables?
10-24-2018, 02:19 AM
Post: #5
RE: Can 50g sysRPL jump to lables?
(10-22-2018 10:11 AM)3298 Wrote:  Jumping to labels sounds like GOTO to me. This SysRPL command exists but is only usable when the containing program is always loaded at a specific address, which is generally not true for user programs. Even for those few commands in ROM that do use it, it might be problematic as it'll subtly break recall-modify-execute procedures applied to them. (The other commands in ROM don't do that, but a user might get that idea.)
I remember writing a relative GOTO (read this thread, there are some designs by others as well) designed to be used with the on-board SysRPL compiler. It's still pretty fragile because you still can't just have another program modify a relative-GOTO-using program between GOTO position and target (it would throw off the offset calculated at compile time), but at least you can move the program to any memory address without breaking it.

However, there are some terms in your request that confuse me. First: "code" - if you want to switch to machine code and later back to RPL, you don't need labels and GOTO, just embed a code object. Second: "call" and "return" - that's obviously something entirely different from jumping to labels. If you want to call subroutines, just embed them, or if you want to call the same one from multiple places: simply store it in some kind of variable (or even on the stack!) when your program launches, then recall and evaluate it when needed.

Thank you very much! Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Can 50g sysRPL jump to lables? - BlackMi - 10-22-2018, 07:09 AM
RE: Can 50g sysRPL jump to lables? - 3298 - 10-22-2018, 10:11 AM
RE: Can 50g sysRPL jump to lables? - BlackMi - 10-24-2018 02:19 AM
RE: Can 50g sysRPL jump to lables? - 3298 - 10-29-2018, 01:36 PM
RE: Can 50g sysRPL jump to lables? - 3298 - 10-30-2018, 10:49 AM
RE: Can 50g sysRPL jump to lables? - 3298 - 10-30-2018, 03:36 PM
RE: Can 50g sysRPL jump to lables? - 3298 - 10-30-2018, 04:54 PM



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