EightBall icon indicating copy to clipboard operation
EightBall copied to clipboard

Relocatable bytecode

Open bobbimanners opened this issue 7 years ago • 1 comments

At present bytecode uses absolute addresses for branches / jumps and is not relocatable. It may be better to use relative branches / jumps so code can be readily relocated within VM memory. Advantages:

  • Portability of bytecode from Linux to Apple II, VIC20, C64 etc.
  • Portability of bytecode between the 8 bit platforms.
  • Eventually, allows some sort of module loading system (a bit like PLASMA has).

Drawbacks:

  • Makes debugging bytecode more painful - this can be overcome with better tools though.

To implement this, we need to add new VM instructions and modify the compiler to use them.

bobbimanners avatar May 01 '18 15:05 bobbimanners

At present, for code to be compatible, both RTPCSTART and RTCALLSTACKTOP must have the same values (in eightballvm.h).

bobbimanners avatar May 13 '18 18:05 bobbimanners