I am following a course in computer architecture and assembly programming in Uni. Some time ago we learned how to write functions in ASM and call them from C. There is one thing I don't understand though -- at the start of every ASM function, the lecturer always makes two instructions;
pushl %ebp
movl %esp, %ebp
I do not understand why he does that, and what effect it has on the function when called. On my Intel Mac, when writing assembly for IA32, it seems to make no difference at all whether I include those instructions or simply skip it.
Can someone tell me what's actually going on when calling on those instructions, and why they are always called at the beginning of an ASM function? Preferably in GNU ASM, although Intel ASM is also okay.