A VM code disassembler is optional for an interpretive system, but highly recommended during its development and maintenance, because it is very useful for detecting bugs in the front end (and for distinguishing them from VM interpreter bugs).
Vmgen supports VM code disassembling by generating file-disasm.i. This code has to be wrapped into a function, as is done in vmgen-ex/disasm.c. You can use this file almost verbatim. In addition to ‘vm_A2B(a,b)’, ‘vm_out’, ‘printarg_type(value)’, which are explained above, the following macros and variables are used in file-disasm.i (and you have to define them):
ip
IP IPTOS
VM_IS_INST(Inst i, int n)