Re: A83: 83 Disassembler


[Prev][Next][Index][Thread]

Re: A83: 83 Disassembler




Correctly dissassembling code in all cases without running it is virtually
impossible.  Two very common techniques in large assembler programs are to
throw data in between routines and to use jump tables.  Detecting data
between routines can be difficult, without keeping track of addresses, as
noted below.  And jump tables make it almost impossible to keep track of
which routines are called.  A good way to dissassemble would be to have an
emulator dissassemble as it goes, and dump the output when it quits.  That
would work for both the ROM and programs.  It would be interactive, but
probably more effective than an interactive dissassembler, because all the
user would have to do is run the program normally, and make sure most
everything is used.  Might be a nice option for VTI some day.  Especially
for the 83+ and 89 apps.

> >    I currently have a 83 Disassembler in beta
> > testing.
> > (Nearly done) It works fine except when it comes to
> > .db statements.  There is no sure way to know if
> > what
> > you are looking at is a .db (.dw ect..) statement or
> > code.
> >
> >   Anyone have any ideas on how to tell the
> > difference
> > between code and a .db statement??
>
> Yes. You have to keep up which areas in memory are
> accessed through LD A,(nnnn) and LD HL,(nnnn), etc.
> The LD HLs are DWs and the LD As are DBs. LD HL,nnnn
> or LD DE,nnnn will highly likely be a series of DBs.
> This serie will continue until an unknown point.
>
> Also keep up which adresses is jumped or called to.
> Called routines are subroutines (until the RET). The
> prevously mentioned 'unknown point' of a series of DBs
> or DWs continues until the first (sub)routine, which
> can be recognized by using the table of jumps/calls.
>
> You can also add some more 'artificial intelligence',
> and for example recognize text (parts of the code
> contains alot of #20s and ASCII codes between "A" and
> "z", most of the time stops with a 0-code).




Follow-Ups: References: