Beta release 0.2.1 can now be downloaded here: http://s000.tinyupload.com/index.php?file_id=37867285792111098461
This is a project to create a controlled disassembler using the TreeView Windows GUI control.
The TreeView control is an ethereal beast: there is substantial documentation on it but it is generally pretty confusing. MS says that adding keys to nodes is optional, but as far as I can tell the only way is add children ("branches") to the tree to reference the key of the parent. Also, the TreeView control's methods must be used directly... the tree nodes themselves have no methods that can be used to create children (the documented node methods don't actually change the tree).
Preliminary tests suggest that the TreeView control has bugs... it does for example create negative index values for its nodes for some reason. I got an out-of-bounds error after making a branch of thousands of nodes that had hundreds of children...
The way the disassembler works is that it starts from a point and disassembles until either unconditional jump or the end of the file. When it encounters a subroutine or conditional branch, it makes a tree branch and a "dummy" node under it, to make the branch real until the user expands it, at which point it disassembles/expands the subroutine in question. In practical terms its current design only works with small programs, particularly as regards the Z80 core I'm using in the prototype. Once I've worked out a decent method for "mapping", it'll be more useful.
The primary advantage of tree-guided "controlled" disassembly is that it gives form to the logical structure of a program. This makes the code itself seem easier and less nebulous to follow. The only real alternative is to use hyperlinks, but even then the brain struggles to cope when there is a great deal of ambiguity (as in the case of raw disassembly). This prototype is making use of low-grade decompilation (to BASIC) to further assist the programmer in comprehending the disassembly. Ideally it would be integrated into an emulator, to allow for a more detailed analysis. (for those wondering, the file disassembled in the screenshot is not a Z80 program, but a random text file, so the disassembly/decompilation looks "buggy" in that it's branching without prior compares).
April 02, 2016, 08:35:26 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I realized that I could deal with the mappers by just creating branches for all the banks. This way the user can disassemble banks as needed.
--nevermind, I realized that won't work because I don't know the start address of the routines except at the last bank. Only way is some kind of multiple document interface scheme so that every bank can have its per bank... unless I had a scheme where you set the text of the branch and use that as the start offset of the disassembly on expansion. Which might work... but it might also be confusing.
The MS TreeView control may not be cut out for this kind of work... may have to make a new version of it for the modern era. Will ask around about that.
I'm just about ready for a release with all the features I had planned in place (including address labeling for hardware and software)... or so I thought. Looks like I'll have to look up MDI for VB6.
v.0.2.1 - fixes in the labeling, added GB proj + binaries
v.0.2 - fixed endianness
v.0.1 - initial release