Re: [hatari-devel] The external disassembler is now really external

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


Am Sat, 20 Aug 2022 22:47:30 +0200
schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:

> Le 20/08/2022 à 22:08, Nicolas Pomarède a écrit :
> > Le 20/08/2022 à 11:24, Thomas Huth a écrit :  
> >>
> >> Now that 2.4.1 has been released, I've committed some patches that 
> >> finally
> >> get rid of the hard-to-maintain "external" disassembler code in Hatari.
> >> But instead of getting rid of the external disassembler completely, I've
> >> replaced it with the Capstone library, so if you don't like the WinUAE
> >> disassembly output, you can still get some more traditional disassembly
> >> that way.
[...]
> Had a first look at the result, seems fine  so far but I think there's 
> an issue if you want to use the disasm output and copy it into devpac 
> for example.
> 
> see this :
> 
> $00fc15b0 : c03c 0007                          and.b     #$7, d0
> 
> there's a ' ' (space) after the ',' and before d0
> 
> If you assemble this line under devpac, you will get an error, d0 will 
> be seen as a missing argument because of the extra ' '.
> 
> If you assemble :
>   and.b #7,d0
> 
> it will work under devpac (I didn't check with vasm)
> 
> Is there any option in capstone to remove such extra formatting ? I 
> think it would be great if disasm result could always be assembled back 
> after a copy/paste into devpac/vasm.

I'm not aware of a way to control this directly in Capstone, but such
spaces can be easily filtered out with a simple loop. I've now added a
patch that does exactly this. You can control the behavior with the lowest
bit in the disassembly options now, e.g. "--disasm 0x7" will remove the
spaces now (and print the instruction in lower case). The lowest bit used
to toggle something different ("hide brackets around absolute addressing"),
but that's the bit that would be very cumbersome to re-implement with
Capstone, and I assume that nobody really needed this anyway, so I decided
to repurpose this bit.

I've also added some code to translate "a7" into "sp" again, so the option
bit that we had for this behavior is now functional again, too. (thus,
I now also think it's ok to keep the option bits for now instead of removing
them completely)

 Thomas



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