I'm working with the GDB debugger right now. Question: In the disassembly file, locate the definition of main. How much stack space (decimal number) does this function allocate for itself?
Here is the function:
08048460 <main>:
8048460: 55 push %ebp
8048461: 89 e5 mov %esp,%ebp
8048463: 83 e4 f0 and $0xfffffff0,%esp
8048466: 83 ec 40 sub $0x40,%esp
8048469: b8 db 0f 49 40 mov $0x40490fdb,%eax
804846e: 89 44 24 08 mov %eax,0x8(%esp)
8048472: b8 ec 78 ad e0 mov $0xe0ad78ec,%eax
8048477: 89 44 24 04 mov %eax,0x4(%esp)
804847b: b8 ec 78 ad 60 mov $0x60ad78ec,%eax
8048480: 89 04 24 mov %eax,(%esp)
8048483: e8 bc ff ff ff call 8048444 <fn1>
8048488: d9 5c 24 3c fstps 0x3c(%esp)
804848c: b8 db 0f 49 40 mov $0x40490fdb,%eax
8048491: 89 44 24 08 mov %eax,0x8(%esp)
8048495: b8 ec 78 ad e0 mov $0xe0ad78ec,%eax
804849a: 89 44 24 04 mov %eax,0x4(%esp)
804849e: b8 ec 78 ad 60 mov $0x60ad78ec,%eax
80484a3: 89 04 24 mov %eax,(%esp)
80484a6: e8 a7 ff ff ff call 8048452 <fn2>
80484ab: d9 5c 24 38 fstps 0x38(%esp)
80484af: c7 04 24 e0 85 04 08 movl $0x80485e0,(%esp)
80484b6: e8 c5 fe ff ff call 8048380 <puts@plt>
80484bb: d9 44 24 3c flds 0x3c(%esp)
80484bf: d8 64 24 38 fsubs 0x38(%esp)
80484c3: dd 1c 24 fstpl (%esp)
80484c6: e8 95 fe ff ff call 8048360 <abs@plt>
80484cb: 89 44 24 2c mov %eax,0x2c(%esp)
80484cf: db 44 24 2c fildl 0x2c(%esp)
80484d3: dd 05 20 86 04 08 fldl 0x8048620
80484d9: d9 c9 fxch %st(1)
80484db: da e9 fucompp
80484dd: df e0 fnstsw %ax
80484df: 9e sahf
80484e0: 0f 97 c0 seta %al
80484e3: 84 c0 test %al,%al
80484e5: 74 21 je 8048508 <main+0xa8>
80484e7: d9 44 24 38 flds 0x38(%esp)
80484eb: d9 44 24 3c flds 0x3c(%esp)
80484ef: d9 c9 fxch %st(1)
80484f1: b8 e8 85 04 08 mov $0x80485e8,%eax
80484f6: dd 5c 24 0c fstpl 0xc(%esp)
80484fa: dd 5c 24 04 fstpl 0x4(%esp)
80484fe: 89 04 24 mov %eax,(%esp)
8048501: e8 6a fe ff ff call 8048370 <printf@plt>
8048506: eb 0c jmp 8048514 <main+0xb4>
8048508: c7 04 24 08 86 04 08 movl $0x8048608,(%esp)
804850f: e8 6c fe ff ff call 8048380 <puts@plt>
8048514: b8 00 00 00 00 mov $0x0,%eax
8048519: c9 leave
804851a: c3 ret
804851b: 90 nop
804851c: 90 nop
804851d: 90 nop
804851e: 90 nop
804851f: 90 nop
I don't understand how to determine this. Is the question asking how much stack space the function allocates for itself before it's called or during the process it was being called? Is it asking how many bytes or how many registers in the stack are being taken up by this function?
I'm new to assembly, so is there a certain technique I should use to answer this question?