Disassembly of a C function
I was trying to understand disassembled code of the following function.
void func(char *string) {
printf("the string is %s\n",string);
}
The disassembled code is given below.
1)0x080483e4 <+0>: push %ebp
2)0x080483e5 <+1>: mov %esp,%ebp
3) 0x080483e7 <+3>: sub $0x18,%esp
4) 0x080483ea <+6>: mov $0x80484f0,%eax
5) 0x080483ef <+11>: mov 0x8(%ebp),%edx
6) 0x080483f2 <+14>: mov %edx,0x4(%esp)
7) 0x080483f6 <+18>: mov %eax,(%esp)
6) 0x080483f9 <+21>: call 0x8048300 <printf@plt>
Could anyone tell me what lines 4-7 means (not the literal explanation).
Also why 24 bytes are allocated on stack on line 3?
No comments:
Post a Comment