我写了一个 c++ 文件,我想把它输出到程序集中。但是,我希望像下面的示例一样优化程序集:
.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
上述程序集是如何生成的。我能够生成的那个充满了垃圾(我不知道如何解释它),我怎样才能缩短它以便我可以手动优化它,编译它并运行它?通过垃圾,我指的是下面的多行。我可以删除它们吗?:
PUBLIC ?value@?$integral_constant@_N$0A@@tr1@std@@2_NB ; std::tr1::integral_constant<bool,0>::value
PUBLIC ?value@?$integral_constant@_N$00@tr1@std@@2_NB ; std::tr1::integral_constant<bool,1>::value
PUBLIC ?value@?$integral_constant@I$0A@@tr1@std@@2IB ; std::tr1::integral_constant<unsigned int,0>::value
PUBLIC ?_Rank@?$_Arithmetic_traits@_N@std@@2HB ; std::_Arithmetic_traits<bool>::_Rank
PUBLIC ?_Rank@?$_Arithmetic_traits@D@std@@2HB ; std::_Arithmetic_traits<char>::_Rank
PUBLIC ?_Rank@?$_Arithmetic_traits@C@std@@2HB ; std::_Arithmetic_traits<signed char>::_Rank
PUBLIC ?_Rank@?$_Arithmetic_traits@E@std@@2HB ; std::_Arithmetic_traits<unsigned char>::_Rank
; COMDAT ?end@?$_Iosb@H@std@@2W4_Seekdir@12@B
CONST SEGMENT
?end@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 02H ; std::_Iosb<int>::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<int>::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<int>::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<int>::binary
CONST ENDS