I'd like to write a Radare2 plugin for a legacy 48-bit word-oriented CPU which has two 24-bit instructions per word, and, naturally, uses word addressing. I wrote a disassembler plugin which prints the instructions, but it is hard to follow the control flow. It would be nice to have word offsets printed on the left instead of the byte offsets, and to be able to specify the way raw instructions are printed.
Is it possible in the current version?
Instead of
0x00001800 002041 mode 101
0x00001803 2a04b0 seti 2260(r2)
0x00001806 aa0542 seti 2502(r12)
0x00001809 6a7fd2 seti 77722(r6) ; 0x0000007f
0x0000180c 00855f ld 2537
0x0000180f 000585 st 2605
0x00001812 01e041 shr 1
0x00001815 6005b4 st 2664(r6)
0x00001818 6f8403 loop 2003(r6)
I would like, ideally, to get something like
02000 00 002 0101 mode 101
02 24 02260 seti 2260(r2)
02001 12 24 02502 seti 2502(r12)
06 24 77722 seti 77722(r6)
02002 00 010 2537 ld 2537
00 000 2605 st 2605
02003 00 036 0101 shr 1
06 000 2664 st 2664(r6)
02004 06 37 02003 loop 2003(r6)
...
(The 0x0000007f comment is likely due to the x86 analyzer which kicks in by default, is that right?)
6A 7F
translates topush 7Fh
. Weird, if you selected a different CPU. It must be hardcoded elsewhere.