by monopede · 15y ago · 0 comments
PUSH the_address_you_want_to_come_back_to
JMP some_other_spot
the_address_you_want_to_come_back_to:
BLAH
BLAH
...
some_other_spot:
BLAH
BLAH
POP some_scratch_address
JMP some_scratch_address
So yes, JSR is two opcodes and RTS is also two opcodes, but it works.You could, of course, do it with self-modifying code if that's possible. (I'm not familiar enough with the VM to know if it is.)