This is the prologue function.
It pushes the old base pointer onto the stack, so it can be restored later:
push ebp
Assigns the value of the stack pointer to the base pointer, then a new stack stack will be created on top of the old stack frame:
mov ebp, esp
Then it moves the stack pointer, decreasing or increasing its value (depending on whether the stack grows up or up):
sub esp, 230h
Here, the immediate value of 230h is the number of bytes reserved on the stack for local use in the function.
Similarly, the epilogue function cancels the prolog and returns control to the calling function.
Check out this related SO question: Prolog and Epilogue function in C
source share