Click to See Complete Forum and Search --> : Assembly and C++ Question


linuxprogrammer
12-30-2004, 06:56 PM
How can i turn a C++ code into Assembly?

:confused:

goon12
12-30-2004, 07:00 PM
I think you can compile it with the -S option.

-goon12

linuxprogrammer
12-30-2004, 07:10 PM
I forgot i be useing gcc and nasm.

goon12
12-30-2004, 07:18 PM
If you have foo.cpp ( I am assuming it's C++ from the original post ) you can compile it with this command:

g++ -S foo.cpp

You should now have foo.s, a.out, along with your original C++ source. foo.s should be the assembly, and a.out is the executable.

-goon12

P.S. - I'm pretty sure the -S option works with both g++ and gcc.