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

Re: OT: Howto get assembly of linux or windows executables ?



Joris writes:

> I'm currrently learning assembly and I'd like to get more used to it
> - is there a way to get to see the assembly of a compiled program,
> what program(s) do I need for that ?

gcc is able to show the assembly it generates with the -S option and
leaves the result in a file of the same name as the input file but
with an ".s" extension.

e.g.: $ gcc -S test.c
      $ cat test.s
	.file	"test.c"
gcc2_compiled.:
	.section	".rodata"
	.align 2
.LC0:
	.string	"hello world!\n"
	.section	".text"
	.align 2
	.globl main
	.type	 main,@function
main:
	stwu 1,-32(1)
	mflr 0
	stw 31,28(1)

etc

For disassembling an executable file the only thing I can think of off
hand is the debugger, such as gdb.

> I may want to look into small windows programs too is that possible

MS-DOS has a program entitled debug. Perhaps it is in that MS-DOS
emulator or FreeDOS?

Elizabeth



Reply to: