Add utility for dumping information from AIN files.
For now this is pretty simplistic. The main use is to dump HLL function
prototypes to help with writing stubs.
Future features:
* dump to JSON format
* full AIN dump which could be rebuilt by a complementary tool, e.g.
to enable editing bytecode for testing purposes.
Implement CALLMETHOD, SH_STRUCTREF and PUSHSTRUCTPAGE instructions.
Constructors are a bit tricky since SH_LOCALCREATE has to implicitly
call an arbitrary number of functions before it returns (just changing
the instruction pointer only allows for calling a single function).
To get around this, there is now a vm_call() function which is used to
call a function synchronously, before returning from the current
instruction.
Methods are implemented as functions, except that they get a struct page
as local variable -1.
Destructors are still not implemented.
An assortment of instructions have been implemented so far, mostly basic
stuff such as stack management. The following program can be executed:
int main(void)
{
hello(2);
for (;;) {
system.Peek();
system.Sleep(1);
}
return 0;
}
void hello(int n)
{
int i;
for (i = 0; i < n; i++) {
system.Output("Hello, world! " + string(i));
}
}