I've been wanting to create an interactive disassembler. It would gather data from code-data-logging the video game you wish to disassemble.
It would then provide options like this for disability;
This inserts a space
It would also allow you to add comments to what will be the eventual disassembly.
Most importantly, you would be able to define labels, equates (including groups of equates that function as flags), and then inside the code, you can make adjustments like:
by making it into a single line, for the disassembler to produce, so you don't have to do it yourself:
You would be able to make use equates and labels by looking up matching labels/equates (or for immediate addressing or single-byte data equates flags as well), like so:
For $8765, the system will find all the labels and equates with that value. For $A8, it would look up the equates flags as well, so you can pick the correct label/equate/equate flag group to substitute in code. It could change to this for example:
Pretty neat, huh? You could also split it up into files, with a master file that includes all the files, which I expect would be useful for disassembling something like Kirby's Adventure, where each bank can have its own source file.
Now, what are some of the best ways to implement this? Should I make use of a toolbar? Should I use a list item to store every line (including the empty spaces, comments, equates, and label names), or perhaps a more generic label that calculates where you're at now in the code?
I'm working on the best design to allow you to do that, to decide exactly how the disassembly, and I wonder if there is any advice anyone could give?
I should design the interface before coding, right?
It would then provide options like this for disability;
Code:
rts
lda #$46
lda #$46
Code:
rts
lda #$46
lda #$46
This inserts a space
It would also allow you to add comments to what will be the eventual disassembly.
Most importantly, you would be able to define labels, equates (including groups of equates that function as flags), and then inside the code, you can make adjustments like:
Code:
.byte $56
.byte $87
.byte $9A
.byte $BB
.byte $87
.byte $9A
.byte $BB
by making it into a single line, for the disassembler to produce, so you don't have to do it yourself:
Code:
.byte $56, $87, $9A, $BB
You would be able to make use equates and labels by looking up matching labels/equates (or for immediate addressing or single-byte data equates flags as well), like so:
Code:
jmp $8765
.byte $A8
.byte $A8
For $8765, the system will find all the labels and equates with that value. For $A8, it would look up the equates flags as well, so you can pick the correct label/equate/equate flag group to substitute in code. It could change to this for example:
Code:
jmp DoStuff
.byte flg3 | $flg4
.byte flg3 | $flg4
Pretty neat, huh? You could also split it up into files, with a master file that includes all the files, which I expect would be useful for disassembling something like Kirby's Adventure, where each bank can have its own source file.
Now, what are some of the best ways to implement this? Should I make use of a toolbar? Should I use a list item to store every line (including the empty spaces, comments, equates, and label names), or perhaps a more generic label that calculates where you're at now in the code?
I'm working on the best design to allow you to do that, to decide exactly how the disassembly, and I wonder if there is any advice anyone could give?
I should design the interface before coding, right?