[comp.sys.amiga.programmer] SAS C disassembly suggestions needed

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) (06/25/91)

I want to turn an executable created by SAS 5.10a into
a disassembled source.  I basically want something that
looks like the mixed display mode of CPR, except I want
the whole enchilada (program) disassembled to a file,
preferably with the 'C' source as assembly language
comments.  Does anyone know if there is a way to do
this?

e-mail please, unless you think the post would help
others.

--
****************************************************
* I want games that look like Shadow of the Beast  *
* but play like Leisure Suit Larry.                *
****************************************************

chucks@pnet51.orb.mn.org (Erik Funkenbusch) (06/26/91)

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
>I want to turn an executable created by SAS 5.10a into
>a disassembled source.  I basically want something that
>looks like the mixed display mode of CPR, except I want
>the whole enchilada (program) disassembled to a file,
>preferably with the 'C' source as assembly language
>comments.  Does anyone know if there is a way to do
>this?
>

Well, there's no way to get commented dis-assemblies in SAS.  you can use OMD
(object module disasembler) to disasemble your object modules.  This was one
of the Main reasons i chose Manx over SAS because with a simple flag you can
get the compiler to keep it's intermediate assembly and comment each function
with the appropriate C source.  Very useful when you wish to optimize code by
hand.

.--------------------------------------------------------------------------.
| UUCP: {amdahl!tcnet, crash}!orbit!pnet51!chucks | "I know he's come back |
| ARPA: crash!orbit!pnet51!chucks@nosc.mil        | from the dead, but do  |
| INET: chucks@pnet51.orb.mn.org                  | you really think he's  |
|-------------------------------------------------| moved back in?"        |
| Amiga programmer at large, employment options   | Lou Diamond Philips in |
| welcome, inquire within.                        | "The First Power".     |
`--------------------------------------------------------------------------'

riley@theory.TC.Cornell.EDU (Daniel S. Riley) (06/26/91)

In article <5214@orbit.cts.com> chucks@pnet51.orb.mn.org (Erik Funkenbusch) writes:
>Well, there's no way to get commented dis-assemblies in SAS.  you can use OMD
>(object module disasembler) to disasemble your object modules.

To clarifly a little:

You can get commented dis-assemblies from SAS...compile with -d (so
that the line number information is included in the object module) and
then give both the object file name and the source file name to omd,
e.g.

omd module.o module.c

and *poof*, commented disassembly.  The big problem with it is that it
is not in a format that any assembler will accept, so you can't
reassemble it without considerable post-processing.  Maybe if we ask
nicely SAS will fix this...
-- 

-Dan Riley (riley@theory.tc.cornell.edu, cornell!batcomputer!riley)
-Wilson Lab, Cornell University

root@becca.rain.com (john meissen) (06/27/91)

In article <5214@orbit.cts.com>, Erik Funkenbusch writes:

> Well, there's no way to get commented dis-assemblies in SAS.  you can use OMD
> (object module disasembler) to disasemble your object modules.  This was one
> of the Main reasons i chose Manx over SAS because with a simple flag you can
> get the compiler to keep it's intermediate assembly and comment each function
> with the appropriate C source.  Very useful when you wish to optimize code by
> hand.

Not true. If you compile with -d (debugging ON) so that line number info is
included in the object module, then you can provide the source file name as
a second argument to OMD and it will mix the source with the disassembled
code. This has been a feature of the Lattice compiler since day-1 (pre-1984).

 John Meissen  | john@becca.rain.com 
               | ..!{uunet,qiclab,intelhf,bucket}!m2xenix!becca!john
--------------------------------------------------------------------
"It's only work if somebody makes you do it." - Calvin & Hobbes

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) (06/27/91)

In article <5214@orbit.cts.com> chucks@pnet51.orb.mn.org (Erik Funkenbusch) writes:
>mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
>>I want to turn an executable created by SAS 5.10a into
>>a disassembled source.  I basically want something that
>>looks like the mixed display mode of CPR, except I want
>>the whole enchilada (program) disassembled to a file,
>>preferably with the 'C' source as assembly language
>>comments.  Does anyone know if there is a way to do
>>this?
>>
>
>Well, there's no way to get commented dis-assemblies in SAS.  you can use OMD
>(object module disasembler) to disasemble your object modules.  This was one
>of the Main reasons i chose Manx over SAS because with a simple flag you can
>get the compiler to keep it's intermediate assembly and comment each function
>with the appropriate C source.  Very useful when you wish to optimize code by
>hand.
>

I am almost finised with a program that takes the output of OMD and turns it
into an honest to goodness assemblable source file.  When it is finished, I
will post it to alt.sources.amiga (if someone tells me how to get ahold of
Tad Guy (sp?) I will send it to him to put on comp.sources.amiga.  Should
be done tomorrow.

--
****************************************************
* I want games that look like Shadow of the Beast  *
* but play like Leisure Suit Larry.                *
****************************************************

hessmann@r2d2.fmi.uni-passau.de (Georg Hessmann) (06/27/91)

In article <1991Jun26.151234.17732@batcomputer.tn.cornell.edu> riley@theory.TC.Cornell.EDU (Daniel S. Riley) writes:
[..]
>
>and *poof*, commented disassembly.  The big problem with it is that it
>is not in a format that any assembler will accept, so you can't
>reassemble it without considerable post-processing.  Maybe if we ask
>nicely SAS will fix this...

Yes, yes!
It will be *very* nice, if we can use the output from omd as
input for asm!!

	Georg.


-- 
  hessmann@unipas.fmi.uni-passau.de		hessmann@unipas.uucp

fjrei@kbsaar.UUCP (Franz-Josef Reichert) (06/29/91)

In article <5214@orbit.cts.com> chucks@pnet51.orb.mn.org (Erik Funkenbusch) writes:
>mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
>>I want to turn an executable created by SAS 5.10a into
>>a disassembled source.  I basically want something that
>>looks like the mixed display mode of CPR, except I want
>>the whole enchilada (program) disassembled to a file,
>>preferably with the 'C' source as assembly language
>>comments.  Does anyone know if there is a way to do
>>this?
>>
>
>Well, there's no way to get commented dis-assemblies in SAS.  you can use OMD
>(object module disasembler) to disasemble your object modules. 

Try OMD <object_file>.o <source_file>.c! You need to
compile at least with -d1.

>| UUCP: {amdahl!tcnet, crash}!orbit!pnet51!chucks | "I know he's come back |

--
Best regards,
Franz-Josef Reichert      VOICE: +49 6805 7417
Kuchlingerstrasse 13      UUCP:  ...uunet!cbmvax!cbmehq!cbmger!kbsaar!fjrei
D-6601 Kleinblittersdorf  GERMANY