Re: [hatari-devel] Dissassembly engine selection

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On perjantai 09 marraskuu 2012, Eero Tamminen wrote:
> So, should I add a command line option like:
> 	--disasm <int>   Select disassembly engine
> ?

As we're definitely NOT going to have more than two
disassembly engines, I changed the "nDisasmEngine"
configuration value to boolean "bDisasmUAE" and added
"nDisasmOptions" for controlling the external disasembler
output flags.

Then I simplified the source a bit and added "--disasm" option
for setting these, see:
http://hg.tuxfamily.org/mercurialroot/hatari/hatari/summary


It works like this:
------------------
$ hatari --disasm help
Disassembly settings:
        uae - use CPU core internal disassembler which has better
              instruction support
        ext - use external disassembler which has nicer output
              and supports options below
        <bitmask> - disassembly output option flags
Flag values:
        1: no brackets around absolute addressing
        2: opcodes in small letters
        4: register names in small letters
        8: stack pointer as 'SP', not 'A7'
Current settings are:
        --disasm ext --disasm 15
$ hatari
....
CPU=$fc0976, VBL=124, FrameCycles=76, HBL=0, LineCycles=76, DSP=N/A
> setopt --disasm 255
....
Error while parsing argument "255" for option "--disasm":
  unknown flags in the bitmask

Option usage:
  --disasm <x> Set disassembly options (help/uae/ext/<bitmask>)
> setopt --disasm uae --disasm 0
Selected UAE CPU core internal disassembler.
Changed CPU disassembly output flags from 15 to 0.
WARNING: disassembly options are supported only for '--disasm ext'!
> d pc
00fc0976: 4ed0 00fc 0652 00fc 33a6 JMP.L (A0)
00fc0978: 00fc 0652 00fc 33a6 00fc ILLEGAL.L 
00fc097a: 0652 00fc 33a6 00fc 3494 ADD.W #$00fc,(A2)
....
> setopt --disasm ext
Selected external disassembler.
Disassembly output flags are 0.
> d pc
$fc0976 : 4ed0                                 JMP       (A0)
$fc0978 : 00fc                                 DC.W      $00fc
$fc097a : 0652 00fc                            ADDI.W    #$fc,(A2)
....
> setopt --disasm 15
Changed CPU disassembly output flags from 0 to 15.
> d pc
$fc0976 : 4ed0                                 jmp       (a0)
$fc0978 : 00fc                                 DC.W      $00fc
$fc097a : 0652 00fc                            addi.w    #$fc,(a2)
....
------------------

Btw. All three lines have minor differences in what the disassemblers
report.  The correct instruction name is "ADDI", not "ADD" like
UAE core reported, but one can see it's immediate version from '#'.
:-)


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/