Some extra ASM
Posted: Sat May 06, 2006 11:00 pm
I am follwing a the little ASM tutorial on osdev.net:
http://www.osdev.net/howtos/1/index.html
But my gcc is giving me some extra asm.
test.c:
int main()
{
}
ndisasm -b 32 test.bin yields:
00000000 55 push ebp
00000001 89E5 mov ebp,esp
00000003 83EC08 sub esp,byte +0x8
00000006 83E4F0 and esp,byte -0x10
00000009 B800000000 mov eax,0x0
0000000E 29C4 sub esp,eax
00000010 C9 leave
00000011 C3 ret
Does anyone know why the extra stuff betwee mov ebp,esp and leave?
Thanks for any feedback.....
http://www.osdev.net/howtos/1/index.html
But my gcc is giving me some extra asm.
test.c:
int main()
{
}
ndisasm -b 32 test.bin yields:
00000000 55 push ebp
00000001 89E5 mov ebp,esp
00000003 83EC08 sub esp,byte +0x8
00000006 83E4F0 and esp,byte -0x10
00000009 B800000000 mov eax,0x0
0000000E 29C4 sub esp,eax
00000010 C9 leave
00000011 C3 ret
Does anyone know why the extra stuff betwee mov ebp,esp and leave?
Thanks for any feedback.....