I would like to read a document describing the VM instruction set, in order to generate bytecode apart from Monkey C code. Is something like that available?
Thanks in advance.
I think there is a compiler option that shows you the bytecodes generated from your code, but that's it. I really, really doubt you'd be able to generate your own ..prg. I'm not sure why you would want to.
We don't document the instructions, the output generated by -g is not bytecode (it is essentially assembler code), and the compiler doesn't currently do much optimization.