Re: [hatari-devel] The external disassembler is now really external |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] The external disassembler is now really external
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sun, 21 Aug 2022 07:53:45 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1661068427; bh=qTVDZzvw69M2hPHgvV2fdz3u8rZvgnqAqJnVr07cyDs=; h=Date:From:To:Subject:From; b=peE6G0B3K5CmGWk93QdmtPBlMBXJmdCUTuwQpyfGRM921c/hPQQ3e0j42gq089LhX DmfE1vW3LQJEoUoBYfKfiZaXAMrniV9tgglwpR6xsvoEeyXsyGpM5CESiCSFQHVtsz CnW5spP/dGsfoO+84dKKlPVbOuFnTrySAVGkv6Gap1tjmT7hMb7bqj6UegzUV13Mxi Tc8kZU2CYOAalj6aNczNSQlrJlhVyyfZua+0MS5CmL7lOxxriPj19Cb/DwwPVwYPV/ H1Pqm73Xur1ly3IC1/Gebrs+EOv5IVg1ISNgjmjEQnO23g5n3eSJG4ypRpmZssXsnW SWU/CzadVvKdw==
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