larsbrinkhoff / pdp10-its-disassembler

Disassembler and other tools for files in ITS formats
GNU General Public License v2.0
19 stars 13 forks source link

Build a symbol table, and show symbols in disassembly. #12

Closed atsampson closed 6 years ago

atsampson commented 6 years ago

Some thoughts about this:

(So, essentially, don't merge this as is, but let me know what you think...)

larsbrinkhoff commented 6 years ago

Thanks. I have been wanting this feature, as you can imagine since you have recreated some source files.

I'll hold off on merging until you feel ready.

larsbrinkhoff commented 6 years ago

Symbolic disassembly of the accumulator field is tricky, because there are usually many symbols defined with values in the 1-17 range. There are usually a few I/O channels which overlap with accumulator symbols, for example.

larsbrinkhoff commented 6 years ago

I think printing labels and symbolic jump targets is a clear win.

It's less clear for some other instructions. E.g. it should probably be ADDI T,1 rather than ADDI T,A.

I can imagine there being a command line option. Set to 0, no symbols will be used. At 1, print symbols for labels and jump instructions. At 2, use symbols everywhere.

atsampson commented 6 years ago

I've added a option for how aggressively to find symbols; it can be not at all (the default), use only non-killed symbols like DDT, or use all symbols. Decoding jump instructions only needs a bit more work.

I've also added some tests, which inevitably found a bug in my search code :-)

larsbrinkhoff commented 6 years ago

I think this is good to merge now. Do you feel ready?

The jump thing can wait. It'll be good to get some experience using this.

atsampson commented 6 years ago

Yes, go for it - I'm happy enough now.

larsbrinkhoff commented 6 years ago

Thanks!