Author Topic: How to! complie the cpp source to the asm code  (Read 2887 times)

wingstrife

  • Guest
How to! complie the cpp source to the asm code
« on: December 13, 2011, 09:08:20 am »
How to! complie the cpp source code to the asm code.....
the option -S just outputs the asm code without any symbol.....how to add the symbol:
for example :

//int a = 10;
asm code may be :

 mov $0xa , 20(%esp);

and it is difficult for reading............
if using this form:

mov $0xa,$a(%esp) ;  ///just like VS

it is easy to understand.....
but how to get asm code with the gcc option in second format.......

possible????
« Last Edit: December 13, 2011, 09:10:48 am by wingstrife »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: How to! complie the cpp source to the asm code
« Reply #1 on: December 13, 2011, 10:27:47 am »
Have you read the rules of the forum? I doubt, so please do so and then ask your question in more appropriate place.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How to! complie the cpp source to the asm code
« Reply #2 on: December 13, 2011, 11:53:50 am »
You may want to read the compiler documentation, as this is not something Code::Blocks does. Since you said it is not like with Visual Studio, I assume you use gcc: http://gcc.gnu.org/onlinedocs/gcc/

Specifically, you will be interested in the chapters "Debugging Options" and "Code Gen Options".
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

wingstrife

  • Guest
Re: How to! complie the cpp source to the asm code
« Reply #3 on: December 14, 2011, 03:05:26 pm »
Have you read the rules of the forum? I doubt, so please do so and then ask your question in more appropriate place.


Sorry.....

wingstrife

  • Guest
Re: How to! complie the cpp source to the asm code
« Reply #4 on: December 14, 2011, 03:06:25 pm »
You may want to read the compiler documentation, as this is not something Code::Blocks does. Since you said it is not like with Visual Studio, I assume you use gcc: http://gcc.gnu.org/onlinedocs/gcc/

Specifically, you will be interested in the chapters "Debugging Options" and "Code Gen Options".


Thanks!