Я только что заметил какой-то странный код языка ассемблера пустого основного метода.
//filename: main.c
void main()
{
}
разборка:
push ebp
mov ebp,esp
sub esp,0C0h; why on the earth is it reserving 192 bytes?
push ebx
push esi
push edi ; good compiler. Its saving ebx, esi & edi values.
lea edi,[ebp-0C0h] ; line 1
mov ecx,30h ; line 2
mov eax,0CCCCCCCCh ; line 3
rep stos dword ptr es:[edi] ; line 4
xor eax,eax ; returning value 0. Code following this line is explanatory.
pop edi ; restoring the original states of edi,esi & ebx
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
- почему на земле он резервирует 192 байта для функции, где нет никаких переменных
- что происходит с четырьмя строками: строка 1, строка 2, строка 3, строка 4? что он пытается сделать и ПОЧЕМУ?