[comp.sys.atari.st] disassemblers

daniel@pkmab.se (Daniel Deimert) (10/16/89)

What disassemblers are there for the ST?  I heard something about a
new german logical disassembler, and that it probably wasn't worth
the price to convert it to english.

I'm looking for a disassembler that can able to do the following
things:

	o  Disassemble from a file, with symbols.
	o  Generate labels.
	o  Recognize illegal instructions and set these to dc.?
	o  Generate code that can directly be assembled again.
	o  .PRG, .TOS, .TTP, .O, .BIN, etc should be handled.
	o  Specification of data-areas should be possible
	o  Hex-codes as a comment as an option
	o  character strings as comments as an option
	o  ...several other things I don't remember right now :-)

The only one I've got is the 'built-in' disassembler in GenST, and
it has errors...

Are there any disassemblers with sourcecode avaiable?  Then it
should be no problem changing the format of the output.


Please e-mail any response to me, or post it to the net.
Daniel


-- 
    Daniel Deimert, Fridstav. 4, S-715 94 Odensbacken, SWEDEN
    Internet:	daniel@pkmab.se
    UUCP:	...{uunet,mcvax}!sunic.sunet.se!kullmar!pkmab!daniel

hcj@lzaz.ATT.COM (HC Johnson) (10/16/89)

In article <2060@pkmab.se>, daniel@pkmab.se (Daniel Deimert) writes:
> 
> I'm looking for a disassembler that can able to do the following
> things:
> 
> 	o  Disassemble from a file, with symbols.
> 	o  Generate labels.
> 	o  Recognize illegal instructions and set these to dc.?
> 	o  Generate code that can directly be assembled again.
> 	o  .PRG, .TOS, .TTP, .O, .BIN, etc should be handled.
> 	o  Specification of data-areas should be possible
> 	o  Hex-codes as a comment as an option
> 	o  character strings as comments as an option
> 	o  ...several other things I don't remember right now :-)
> 
Twice I have postted distomwc, which is PD, and derived form another PD
called dis.

"... with symbols".  distomwc only accepts DRI symbols. Every compiler
has its own symbol format.  I found that what I wanted to disassemble
didn't have symbols anyway.

distomwc does the rest.  Its output is MWC assembler compatible.

If you are a MWC fan, remember to save your 2.0 version of as.  call it oas.
the 3.0 version doesn't know what to do with a ".s" short branch.

distowmc allows use of a control file that supplies symbols, and marks
as words or ascii, sections of .text.

What I do:
A. disassemble , and look at the resulting file.
Identify the embedded .ascii, and .words and put the areas into the control
file. (.ascii makes reams of strange instructions; .words can through off
the decoding of the next instruction).
B. disassemble again.
C. assemble it, and deal with the errors:
	they are usually:
1. form 0x426:s ; MWC as will handle only NAMES, name:s.  create names.
   most of the references are to ATARI system variables any way.
2. Backward references from switch statements, where a list of addresses
   show up in .data pointing to .text that does not look like the start
   of code.  (no preceding jmp or rts).  Add the symbols.
3. Some references to odd byte offets in data or (oh no) .test itself.
   add and equate to the real symbol.

D. when assembly is clean, 
E. ld it (-s) to produce s .prg that should resemble the input.

	some simple tools:
	1. modify cmp to subtract the haeader (0x1c) from addresses.
	2. print the relocation table as addresses.
	3. remove mwc 3.0 debugging info from ld output.

F. first I compare the relacation tables.
G. when relo is ok, remove the debugging info, and cmp the files.
	This should be very clean.  
	1. one thing showing up is move.b $0xff,d0, this type will have
	   DRI generate 00FF as the constant word, MWC generates FFFF.
	   Both work, but show up in cmp.


Howard C. Johnson
ATT Bell Labs
att!lzaz!hcj
hcj@lzaz.att.com


Scan the .prg for obvious ascii strings.