ZornsLemma/py8dis

Enhancement: specify CPU type on load() instead of via "import tracefoo", check assembler-CPU compatibility

Closed this issue · 2 comments

As suggested by Toby on #5:

Some further thoughts for consideration:

The assembler files (e.g. acme.py) could have a property returning the list of CPUs it supports. (e.g. acme gives ["6502", "65C02"]; z88dk returns ["8080", "z80"] etc). Perhaps an enum would help.
The load() function could take a new parameter specifying the CPU required to disassemble the binary file. (This would replace the 'import trace6502' method of doing things).
The assembler would still be specified on the command line as now unchanged.
The load() function could then properly report if an unsupported combination is chosen.
The assemblers should more neatly be classes, since they share some kind of interface.

See that pull request for more discussion but load() should probably accept a singleton CPU object as an optional alternative to a CPU type enum.

Can be closed now implemented.

Thanks Toby!