mkw icon indicating copy to clipboard operation
mkw copied to clipboard

Clean up disassembler

Open riptl opened this issue 3 years ago • 1 comments

The current disassembler routine is a hack. It starts by invoking Capstone, which doesn't support the complete Gekko instruction set. Capstone is going to abort on undefined instructions. We fall back to custom disassembler extensions for the rest.

Ideally, we'd want to use only one disassembler. Options:

  1. Add paired-singles support to Capstone
  2. Drop Capstone and build a custom pure-Python disassembler

riptl avatar Jul 31 '21 10:07 riptl

I did some research into Capstone / LLVM. Capstone uses LLVM's TableGen sources to auto-generate .inc C sources. The tooling is here: https://github.com/aquynh/capstone/tree/next/suite/synctools Upstream LLVM is missing paired-single support, but I found a fork that has it:

  • https://github.com/DarkKirb/llvm-project/tree/llvm-750cl-v2
  • https://github.com/DarkKirb/llvm-project/tree/llvm-750cl
  • https://github.com/DarkKirb/llvm-project/tree/llvm-ppc-eabi

I couldn't get code-generation to work regardless using llvm-tblgen-12. I've reached out to DarkKirb to see if they are available to help out. I'll leave this until then.

cc @riidefi any ideas? Could you take a look?

riptl avatar Jul 31 '21 18:07 riptl