disassembly of 6803 code

Christian Hack christianh at pdd.edmi.com.au
Thu Sep 7 23:31:05 GMT 2000


> Date: Thu, 07 Sep 2000 06:19:17 +1000
> From: Peter Gargano <peter at techedge.com.au>
> Subject: Re: disassembly of 6803 code
> 
> Christian Hack wrote:
> 
> > I have personally used DasmX to disassemble the 6802 code from
> > my Nissan ECU. I then used Motorola's freeware assembler to put
> > it back together. Doing this I end up with an exact binary image
> > matching the original. 
> 
> A "disassembler" that produces a string of DB, or DW instructions
> will fulfil the requirements of your example.
> 
> > I didn't have to manually hack the code
> > after dissassembling either. It just goes straight into the assembler
> 
> But did you hack the code, and did it still work afterwards?

Yes, read below

> 
> I'd be surprised if any disassembler will automatically generate code 
> that adequately reflects non-trivial source code -- example..
> 
> Often source code will do something like:
> 
>   ldX	#label01+offset01
> 
> but the disassembler will only produce:
> 
>   ldX	#label02

True. I doubt even the most expensive dissassembler could or would
do this.

> 
> If the size of the table at label01 is changed, or there are variables
> you add between label01 and offet01,  then the code will assemble, 
> but the table address for the disassembled "source" will now be at the 
> wrong address.
> 

I see your point here. In my code, all the tables bar 1 or two are at the 
very end of the code. Most of the code I have been adding is in unused
space between the code (at the beginning) and the tables (at the end).

All I have to do is remove some of this unused code and replace it with
my code. DasmX is pretty good with tables and labels and such but I make sure 
that the tables and coefficients etc don't move. I don't know whether IDA
is smart enough to do this for you but DasmX is free remember.

I have successfully added a serial port and code to drive it to my ECU.
Everything appears to run correctly although there is one strange side
effect. The LEDs used for error codes and mixture diagnostic flash
strange codes when I run my serial port code. I think this may be 
due to where I mapped the 16550 into the address space. I haven't
played with it for while so I haven't worked out the exact reason yet.


Christian Hack
DESIGN ENGINEER
christianh at pdd.edmi.com.au
EDMI Product Development Division
Ph : +61 7 3881 6444
FAX : +61 7 3881 6420


----------------------------------------------------------------------------
To unsubscribe from diy_efi, send "unsubscribe diy_efi" (without the quotes)
in the body of a message (not the subject) to majordomo at lists.diy-efi.org




More information about the Diy_efi mailing list