EightBall
EightBall copied to clipboard
Relocatable bytecode
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.
At present, for code to be compatible, both RTPCSTART and RTCALLSTACKTOP must have the same values (in eightballvm.h).