c编译成asm后好多看不懂,请赐教
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.10.25019.0TITLE C:\Users\Administrator\Documents\Visual Studio 2017\Projects\1.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
CONST SEGMENT
$SG5328 DB 'Hello World!', 0aH, 00H
CONST ENDS
PUBLIC ___local_stdio_printf_options
PUBLIC __vfprintf_l
PUBLIC ??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ ; __vcrt_va_start_verify_argument_type<char const * const>
PUBLIC _printf
PUBLIC _main
PUBLIC ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
EXTRN ___acrt_iob_func:PROC
EXTRN ___stdio_common_vfprintf:PROC
; COMDAT ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA
_BSS SEGMENT
?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA DQ 01H DUP (?) ; `__local_stdio_printf_options'::`2'::_OptionsStorage
_BSS ENDS
; Function compile flags: /Odtp
_TEXT SEGMENT
_main PROC
; File c:\users\administrator\documents\visual studio 2017\projects\1.cpp
; Line 2
push ebp
mov ebp, esp
; Line 3
push OFFSET $SG5328
call _printf
add esp, 4
; Line 4
xor eax, eax
; Line 5
pop ebp
ret 0
_main ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT _printf
_TEXT SEGMENT
__Result$ = -8 ; size = 4
__ArgList$ = -4 ; size = 4
__Format$ = 8 ; size = 4
_printf PROC ; COMDAT
; File c:\program files (x86)\windows kits\10\include\10.0.15063.0\ucrt\stdio.h
; Line 952
push ebp
mov ebp, esp
sub esp, 8
; Line 955
call ??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ ; __vcrt_va_start_verify_argument_type<char const * const>
lea eax, DWORD PTR __Format$
mov DWORD PTR __ArgList$, eax
; Line 956
mov ecx, DWORD PTR __ArgList$
push ecx
push 0
mov edx, DWORD PTR __Format$
push edx
push 1
call ___acrt_iob_func
add esp, 4
push eax
call __vfprintf_l
add esp, 16 ; 00000010H
mov DWORD PTR __Result$, eax
; Line 957
mov DWORD PTR __ArgList$, 0
; Line 958
mov eax, DWORD PTR __Result$
; Line 959
mov esp, ebp
pop ebp
ret 0
_printf ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT ??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ
_TEXT SEGMENT
??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ PROC ; __vcrt_va_start_verify_argument_type<char const * const>, COMDAT
; File d:\vs2017enterprise\vc\tools\msvc\14.10.25017\include\vadefs.h
; Line 144
push ebp
mov ebp, esp
; Line 146
pop ebp
ret 0
??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ ENDP ; __vcrt_va_start_verify_argument_type<char const * const>
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT __vfprintf_l
_TEXT SEGMENT
__Stream$ = 8 ; size = 4
__Format$ = 12 ; size = 4
__Locale$ = 16 ; size = 4
__ArgList$ = 20 ; size = 4
__vfprintf_l PROC ; COMDAT
; File c:\program files (x86)\windows kits\10\include\10.0.15063.0\ucrt\stdio.h
; Line 640
push ebp
mov ebp, esp
; Line 641
mov eax, DWORD PTR __ArgList$
push eax
mov ecx, DWORD PTR __Locale$
push ecx
mov edx, DWORD PTR __Format$
push edx
mov eax, DWORD PTR __Stream$
push eax
call ___local_stdio_printf_options
mov ecx, DWORD PTR
push ecx
mov edx, DWORD PTR
push edx
call ___stdio_common_vfprintf
add esp, 24 ; 00000018H
; Line 642
pop ebp
ret 0
__vfprintf_l ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; COMDAT ___local_stdio_printf_options
_TEXT SEGMENT
___local_stdio_printf_options PROC ; COMDAT
; File c:\program files (x86)\windows kits\10\include\10.0.15063.0\ucrt\corecrt_stdio_config.h
; Line 85
push ebp
mov ebp, esp
; Line 87
mov eax, OFFSET ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
; Line 88
pop ebp
ret 0
___local_stdio_printf_options ENDP
_TEXT ENDS
END
这是典型的HelloWorld c语言程序,用cl编译成asm后,有几个地方没明白啥意思。
比如下面这一段,没有见过呀!请高手看看能给说一下吧!~感谢~
$SG5328 DB 'Hello World!', 0aH, 00H
CONST ENDS
PUBLIC ___local_stdio_printf_options
PUBLIC __vfprintf_l
PUBLIC ??$__vcrt_va_start_verify_argument_type@QBD@@YAXXZ ; __vcrt_va_start_verify_argument_type<char const * const>
PUBLIC _printf
PUBLIC _main
PUBLIC ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
EXTRN ___acrt_iob_func:PROC
EXTRN ___stdio_common_vfprintf:PROC
; COMDAT ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA
还有
mov eax, OFFSET ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA ; `__local_stdio_printf_options'::`2'::_OptionsStorage
又是什么意思呢? 附上c语言程序:
#include <stdio.h>
int main(){
printf("Hello World!\n");
}
页:
[1]