Version 3 of disassemble

Updated 2012-10-21 21:11:12 by dkf

Bytecode disassemby command.

tcl::unsupported::disassemble proc procName
tcl::unsupported::disassemble lambda lambdaTerm
tcl::unsupported::disassemble script script
tcl::unsupported::disassemble method class method
tcl::unsupported::disassemble objmethod object method


Disassembles the bytecode of a procedure, lambda/apply term, general script, etc. and returns the disassembly. The format is formally undefined, but is really an exposure of the disassembler built in since 8.0 when compiling with the correct options and can probably be read by anyone who has ever read any assembly code without much difficulty. Understanding the bytecodes requires reading tclCompile.c and (possibly) tclExecute.c. Will not disassemble anything created by tbcload.


It's unfortunately not at all compatible with the assemble command; the formats are quite different (though the opcodes themselves are the same).