Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to produce optimized assembly from c++ code in visual studio 2010
    primarykey
    data
    text
    <p>I have written a c++ file and i want to output it into assembly. However, I want the assembly to be optimized like the example below: </p> <pre><code>.386 .model flat, c ; Custom Build Step, including a listing file placed in intermediate directory ; but without Source Browser information ; debug: ; ml -c -Zi "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)" ; release: ; ml -c "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)" ; outputs: ; $(IntDir)\$(InputName).obj ; Custom Build Step, including a listing file placed in intermediate directory ; and Source Browser information also placed in intermediate directory ; debug: ; ml -c -Zi "-Fl$(IntDir)\$(InputName).lst" "-FR$(IntDir)\$(InputName).sbr" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)" ; release: ; ml -c "-Fl$(IntDir)\$(InputName).lst" "-FR$(IntDir)\$(InputName).sbr" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)" ; outputs: ; $(IntDir)\$(InputName).obj ; $(IntDir)\$(InputName).sbr .code _TEXT SEGMENT _p$ = -8 _Array$ = 8 _size$ = 12 ClearUsingPointers PROC NEAR ; ClearUsingPointers, COMDAT ; Line 15 push ebp mov ebp, esp sub esp, 204 ; 000000ccH push ebx push esi push edi lea edi, DWORD PTR [ebp-204] mov ecx, 51 ; 00000033H mov eax, -858993460 ; ccccccccH rep stosd ; Line 17 mov eax, DWORD PTR _Array$[ebp] mov DWORD PTR _p$[ebp], eax jmp SHORT $L280 $L281: mov eax, DWORD PTR _p$[ebp] add eax, 4 mov DWORD PTR _p$[ebp], eax $L280: mov eax, DWORD PTR _size$[ebp] mov ecx, DWORD PTR _Array$[ebp] lea edx, DWORD PTR [ecx+eax*4] cmp DWORD PTR _p$[ebp], edx jae SHORT $L278 ; Line 18 mov eax, DWORD PTR _p$[ebp] mov DWORD PTR [eax], 0 jmp SHORT $L281 $L278: ; Line 19 pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 ClearUsingPointers ENDP ; ClearUsingPointers _TEXT ENDS END </code></pre> <p>How has the above assembly been generated. The one that i am able to generate is full of garbage(i don't know how else to explain it), How can i shorten it so i can optimize it manually, compile it and run it? BY garbage i am referring to multiple lines like those below. Can i delete them? : </p> <pre><code>PUBLIC ?value@?$integral_constant@_N$0A@@tr1@std@@2_NB ; std::tr1::integral_constant&lt;bool,0&gt;::value PUBLIC ?value@?$integral_constant@_N$00@tr1@std@@2_NB ; std::tr1::integral_constant&lt;bool,1&gt;::value PUBLIC ?value@?$integral_constant@I$0A@@tr1@std@@2IB ; std::tr1::integral_constant&lt;unsigned int,0&gt;::value PUBLIC ?_Rank@?$_Arithmetic_traits@_N@std@@2HB ; std::_Arithmetic_traits&lt;bool&gt;::_Rank PUBLIC ?_Rank@?$_Arithmetic_traits@D@std@@2HB ; std::_Arithmetic_traits&lt;char&gt;::_Rank PUBLIC ?_Rank@?$_Arithmetic_traits@C@std@@2HB ; std::_Arithmetic_traits&lt;signed char&gt;::_Rank PUBLIC ?_Rank@?$_Arithmetic_traits@E@std@@2HB ; std::_Arithmetic_traits&lt;unsigned char&gt;::_Rank ; COMDAT ?end@?$_Iosb@H@std@@2W4_Seekdir@12@B CONST SEGMENT ?end@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 02H ; std::_Iosb&lt;int&gt;::end CONST ENDS ; COMDAT ?cur@?$_Iosb@H@std@@2W4_Seekdir@12@B CONST SEGMENT ?cur@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 01H ; std::_Iosb&lt;int&gt;::cur CONST ENDS ; COMDAT ?beg@?$_Iosb@H@std@@2W4_Seekdir@12@B CONST SEGMENT ?beg@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 00H ; std::_Iosb&lt;int&gt;::beg CONST ENDS ; COMDAT ?binary@?$_Iosb@H@std@@2W4_Openmode@12@B CONST SEGMENT ?binary@?$_Iosb@H@std@@2W4_Openmode@12@B DD 020H ; std::_Iosb&lt;int&gt;::binary CONST ENDS </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload