DruinkScript's VM is coming along nicely. The assembler is complete, but could do with a few more opcodes - I'll add those later on.
DruinkScript's string class is working nicely too, it makes a linked list of char[32] buffers so string operations don't have to screw about with a huge string.
There's a bunch of documented preprocessor #defines in DruinkScript.h that you can define or comment out when building the source code to do several things. At the moment there is:
- DRUINKSCRIPT_NO_STDIO - Removes the DruinkScript::VM::LoadScriptFromFile() function, meaning the lib doesn't link with any file IO functions. Might save a few K of the exe size I suppose, and might be handy on other platforms.
- DRUINKSCRIPT_PARANOID - Validate a lot more stuff than usual. For instance, there's 10 registers available. With DRUINKSCRIPT_PARANOID defined, and an opcode involving a register is read, the register number is checked to make sure it's 0..9. If you're compiling all the scripts yourself, and it's unlikely or impossible that the compiled script will become corrupt, you can comment this define out.
- Another one that I can't remember just now.
And I'll need one to switch to std::string from my own string implementation.
So far I can run about a third of my test script. The mov, mul, div, add, sub and neg instructions are complete, one version for reg<-reg, reg<-int, reg<-float and reg<-string.
Well, end of ramble - back to work.