HP50g: local LBL and GOTO in user or sysRPL
|
09-07-2016, 10:15 PM
Post: #6
|
|||
|
|||
RE: HP50g: local LBL and GOTO in user or sysRPL
(09-07-2016 08:21 PM)3298 Wrote: Why wouldn't relative GOTOs in Saturn ASM work? I thought the whole point of relative jumps was that you could relocate the entire code... I was also playing around with this concept, but using Debug4x/Emu48 instead of the onboard compiler. I was successful making the jump, but realized pretty quickly that the interpreter pointer (D0) needed to be updated to keep it from acting more like a GOSUB. That's where things started getting messy. Updating D0 to point to the new next object seems straightforward enough, but "fixing" the RPL return stack has so far eluded me. Here's what I have so far as a test: Code: :: The output of the above code is: Code: "begin" Having said all this, I still agree with 3298 and Han that this is probably not a very robust solution. I can imagine that a common place you might want to use a GOTO would be embedded in some kind of loop structure (or worse yet, multiple layers deep). Those are exactly the type of situations that would cause problems with this approach, since the RPL return stack would require manipulation that would depend on the exact status of the loop(s) you were trying to exit from. Keeping track of all that would quickly negate any GOTO advantage over simply using normal coding structures from the start. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)