Post Reply 
Can 50g sysRPL jump to lables?
10-24-2018, 03:03 AM
Post: #6
RE: Can 50g sysRPL jump to lables?
(10-24-2018 02:07 AM)BlackMi Wrote:  It says GOTO can only jump to the next address. Could GOTO code jump to any blocks you want?

The "next address" referred to in that documentation is the next 5 nibbles after the GOTO command reference in the current run stream.

IMHO, SysRPL GOTO is really only useful in a general sense to developers of ROM images, as they are likely to be writing code that will be in known (or predictable) positions in memory. SysRPL programs in the general sense are simply not well-suited to GOTOs as a result of the delicate stack structures/error frames/lambda environments that could easily be broken by attempting to jump between code blocks.

You can't ever assume that SysRPL code you write will be in a fixed location. As such, you can't know in advance the address to specify that would be appropriate to jump to in your own code. If you're wanting to jump into a specific ROM address, you would need to know exactly what that code does before returning control to the SOL (system outer loop). Also, it has to be structured as a SysRPL stream (ie. not straight machine code). If you're at that level, you may as well be coding in Saturn assembly anyway.

Shorter version: forget about SysRPL GOTO. It isn't there for standard (relocatable) SysRPL code. Use standard SysRPL structures instead (if-then-else, case, begin-while-repeat, do-loop, etc.). SysRPL also offers certain runstream alterations that can achieve similar behaviors to break and continue if used carefully.
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? - DavidM - 10-24-2018 03:03 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)