Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int foo() {
- volatile int i = 0; // force it to be stored to memory
- return i;
- }
- ;;; MSVC -O2
- _i$ = -4 ; size = 4
- int foo(void) PROC ; foo, COMDAT
- push ecx
- mov DWORD PTR _i$[esp+4], 0 ; note this is actually [esp+0] ; _i$ = -4
- mov eax, DWORD PTR _i$[esp+4]
- pop ecx
- ret 0
- int foo(void) ENDP ; foo
- ;;; MSVC -O0
- _i$ = -4 ; size = 4
- int foo(void) PROC ; foo
- push ebp
- mov ebp, esp ; make a stack frame
- push ecx
- mov DWORD PTR _i$[ebp], 0
- mov eax, DWORD PTR _i$[ebp]
- mov esp, ebp
- pop ebp
- ret 0
- int foo(void) ENDP ; foo
Add Comment
Please, Sign In to add comment