Code::Blocks
July 26, 2014, 03:03:11 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The new Release 13.12 is out! You can download binaries for windows, mac and many major linux distros from  http://www.codeblocks.org/downloads/26 .
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: How do you get MingW to output a .asm file  (Read 4819 times)
hckr83
Advanced newcomer
*
Offline Offline

Posts: 38


« on: July 16, 2006, 01:07:59 am »

Hi how do you get the mingw included with codeblocks to output a .asm file?
Logged
thomas
Administrator
Lives here!
*****
Offline Offline

Posts: 3938



« Reply #1 on: July 16, 2006, 01:26:45 am »

For example:
1. do not use the -pipe switch
2. use the -S switch
Logged

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."
hckr83
Advanced newcomer
*
Offline Offline

Posts: 38


« Reply #2 on: July 16, 2006, 01:42:39 am »

I tried -s(lowercase) and nothing happened and then I tried -S(uppercase) and now it gives a linker error on my object files
Logged
thomas
Administrator
Lives here!
*****
Offline Offline

Posts: 3938



« Reply #3 on: July 16, 2006, 01:44:55 am »

I tried -s(lowercase) and nothing happened and then I tried -S(uppercase) and now it gives a linker error on my object files
Obviously Smiley

It nevertheless does exactly what you wanted.

Code:
D:\desktop>echo int main(){return 0;} > foo.c

D:\desktop>gcc -S foo.c -o foo.asm

D:\desktop>cat foo.asm
        .file   "foo.c"
        .def    ___main;        .scl    2;      .type   32;     .endef
        .text
.globl _main
        .def    _main;  .scl    2;      .type   32;     .endef
_main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        movl    $0, %eax
        addl    $15, %eax
        addl    $15, %eax
        shrl    $4, %eax
        sall    $4, %eax
        movl    %eax, -4(%ebp)
        movl    -4(%ebp), %eax
        call    __alloca
        call    ___main
        movl    $0, %eax
        leave
        ret

D:\desktop>
Logged

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."
hckr83
Advanced newcomer
*
Offline Offline

Posts: 38


« Reply #4 on: July 16, 2006, 01:57:35 am »

*checks .obj's

wow your right!
thanks for the help

edit:
lol bad thing is I still have no idea whats wrong with my code
« Last Edit: July 16, 2006, 02:03:20 am by hckr83 » Logged
mmkider
Almost regular
**
Offline Offline

Posts: 150


« Reply #5 on: February 18, 2009, 02:04:15 pm »

*checks .obj's

wow your right!
thanks for the help

edit:
lol bad thing is I still have no idea whats wrong with my code
Now I Interest .asm for .c file.
I found this solution.
In your Interested file, you insert this follow command  in  this field of "Use custom command to build this file" of advanced tab.
           
Good luck.

Code:
       $compiler -S $file
       $compiler $options $includes -c $file -o $object


Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!