User forums > General (but related to Code::Blocks)
how to generate .s(assembly) file when compiling code ?
huzhongshan:
I added -S in other options , but no response.
I found it generate .s in a tempory directory , but after compile , it disapseared.
I write inline assembly code ,but there is some error in it , I want to find the .s file to see where the bugs.
How can I get the .s file in ide.
I knew I could get it using command line gcc -S ... .....
but in IDE , how ?
Jenna:
You can place it in "Compiler settings -> Other options".
The assembly code will be in the *.o-files in this case (because C::B uses the -o-option), and it will be done for all processed files.
Or you can change the build-command for your file in the files properties (tab "advanced"):
check "Use custom command ..." and add
--- Code: ---$compiler $options $includes -S -c $file
$compiler $options $includes -c $file -o $object
--- End code ---
.
The example is for c++-files.
I double the command, so the file will be processed twice, one-time only the assembly is generated, the second time I do the normal processing, otherwise your build will be broken due to missing object-file or because an old object-file is taken (if it exists).
tiwag:
you have to pass the "enable listings" options to the assembler
http://sourceware.org/binutils/docs/as/a.html#a
do this with the compiler-option "-Wa,"
e.g.
if you want to pass enable listing options "-alhds" to the assembler
you have to use the compiler-option "-Wa,-alhds"
you get the listing in the compiler-build-log, just enable "Save build log" in global compiler settings.
arp:
Add option "-save-temps".
manmeetvirdi:
Hi there
Just needed the knowhow for generating assembly code from C.
So I was trying to follow jens method but in mine case the "check" option is disabled as shown in attached picture !!
So how to proceed next?
Iam using codeblocks-ep
Navigation
[0] Message Index
[#] Next page
Go to full version