Disassemble returns opcodes as a string.
()
| 74 | |
| 75 | // Disassemble returns opcodes as a string. |
| 76 | func (program *Program) Disassemble() string { |
| 77 | var buf bytes.Buffer |
| 78 | w := tabwriter.NewWriter(&buf, 0, 0, 2, ' ', 0) |
| 79 | program.DisassembleWriter(w) |
| 80 | _ = w.Flush() |
| 81 | return buf.String() |
| 82 | } |
| 83 | |
| 84 | // DisassembleWriter takes a writer and writes opcodes to it. |
| 85 | func (program *Program) DisassembleWriter(w io.Writer) { |