Re: A83: 83 Disassembler


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

Re: A83: 83 Disassembler




In a message dated 10/11/99 4:35:03 AM Central Daylight Time, 
laurensh1@yahoo.com writes:

> >    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).
>  
>  Hope to have helped you with this, 
>  
>  ~Grauw
>  

Hmm, those are some very good ideas, not something that wll be fun to code 
though, but i can see no other way to do it. You should also detect if it's 
shell compatible, and by the headers that we know, turn that into .db and .dw 
statements accordingly... That part about searching for RET statements in 
subroutines might not always work though. The programmer could at any point 
in there pop the return address of the stack and do a jump if they wanted to. 
You'd have to keep track of any other calls and jumps in there.... Hmm, if 
this program you are making is also going to be for the 83+, that may get a 
little messier, because on there you know that calls to subroutines are a 
macro of a Restart statement followed by the word address of where to make 
the call. I suppose in the process of displaying the dissassembly for those, 
you could just turn it into " bcall(Label)" whenever you come to a RST $28 
command... Well, this sounds like a cool program though. So thats where youve 
been for a while, making this... =P  Anyways, good luck to ya on 
incorporating the code to fix this problem, cya...

Jason_K


Follow-Ups: