gnupic: gpdasm/gpsim disassembly output
Subject:
Re: gpdasm/gpsim disassembly output
From:
David McNab ####@####.####
Date:
14 Jan 2005 00:59:15 +0000
Message-Id: <41E7195C.2050006@rebirthing.co.nz>
David McNab wrote:
> What I'm wanting is an option to make gpdasm generate similar
> disassembly to gpsim - where known SFR addresses and their constituent
> bits are decoded to names.
>
> I've worked around the shortfall by loading hex files into a gpsim
> console, doing a full disassembly, then copying/pasting the full
> disassembly from the console into a file.
>
> Not quite ideal, but gives me what I need.
>
> I'll probably do a hack to gpsim so that a single command line can
> choose a processor, load a hex file (eg 'myfile.hex'), and spit its
> disassembly to a file 'myfile.dis'.
On second thought, no need to hack gpsim.
Would just take a simple Python script to:
- generate a gpsim script containing 'processor', 'load' and
'disassemble' commands
- run gpsim against this script, and snarf the output
- parse the output and weed out superflous lines
- parse the .map file and find out where everything lives
- cross reference everything, and generate a final .dasm
file, which could be assembled to produce exactly the
same binary as the original
If/when I hack up such a thing (perhaps later today), I'll post it to
this list.
Cheers
David