diff --git a/virtual_machine/disasm.h b/virtual_machine/disasm.h new file mode 100644 index 000000000..f963bee18 --- /dev/null +++ b/virtual_machine/disasm.h @@ -0,0 +1,16 @@ +#ifndef DISASM_H +#define DISASM_H + +#include "bytecode.h" +#include + +/* Disassemble all public symbols in bc, writing output to f. + Returns 0 on success, -1 on error. */ +int disasm(const bytecode *bc, FILE *f); + +/* Disassemble a single function starting at code_offset within bc->code, + writing output to f. name may be NULL. */ +int disasm_func(const bytecode *bc, size_t code_offset, const char *name, + uint8_t flag, FILE *f); + +#endif /* DISASM_H */