Re: 6809 assembler and dasm question

From: Duncan Brown <BROWN_DU_at_Eisner.DECUS.Org>
Date: Sun Apr 12 1998 - 12:20:08 EDT

> Also, I've been using Sean Riddle's 6809dasm program and have noticed that
> it puts data and ascii next to the memory addresses it came from. This
> won't work for assemblers (at least the ones I've used in the past). It
> needs to have a way to define bytes (db?) and ascii for the assembler.

    I haven't used Sean's disassembler or (obviously) Jess', but it
    sounds like they are "hacking" disassemblers (used for reverse
    engineering programs efficiently) while you seem to be looking for
    a "sourcing" disassembler (one whose output can be fed right back
    into an assembler, generally to prove it produces the same binary,
    or as the beginning of a modification-after-reverse-engineering
    project.) Sourcing disassemblers are extremely hard to do
    well...and of course they need massive feedback from a human in
    the loop to sort out data tables, jump tables, parameters sitting
    after subroutine calls, etc. (I used "Sourceror" on the Apple II+
    to begin my long journey of producing a commented source for
    Asteroids, as an example...and as a way to date myself, heh heh
    heh...)

> Jess, I have a suggestion for your dissassemblers. Put in some kind of
> switch to turn off the address: that leads every line, and make it enclose
> data and ascii in whatever directives the assembler needs.
> It would also be cool to have it put a label for a subroutine where the
> assembler expects it (I assume this should still be to the left of the
> first instruction of the subroutine)

    But having "address:" for every line is a crude but extremely
    effective start on the sourcing disassembler you want! You
    generally have to make labels start with alpha characters, so
    making the labels of the format "H123F:" for instance will solve
    that problem. Then all absolute memory references can be
    disassembled to the format of "JSR H123F" without having to look
    ahead or back and make sure the target of that reference was
    successfully disassembled to start on that address. 90% of your
    work is now done. All you have to do is fix up the beginnings and
    ends of data areas...and get rid of all unused labels, if you
    desire. FWIW, Sourceror actually went to the trouble of getting
    rid of labels it saw no reference to, but did *not* do anything
    about using absolute references it discovered to fix up the edges
    of data (since the absolute reference it discovered could just as
    easily be some data that was mistakenly disassembled!)

    If anyone is interested in this enough to the point of spending
    some serious bucks, I could dig up the info I got years ago about
    some commercial sourcing disassembler/reassembler products. Their
    ostensible purpose was to recover source code for your own
    company, where all that was left was the binary. They looked
    seriously powerful, capable...and expensive. I have no idea if
    the companies are even still around...as nobody is doing embedded
    6809 work any more, right? (I'm trying to be humorous...)

    Duncan
Received on Sun Apr 12 09:21:51 1998

This archive was generated by hypermail 2.1.8 : Thu Jul 31 2003 - 23:00:43 EDT