METHOD with PROLOGUE EPILOGUE
Modifiying esp inside a prologue don't work because EBP need to adress the argument of the function and the local variables.
It is the compiler who give the decalages to ebp and don't take care of a possible change of esp.Mov ebp,esp his followed by the
creation of the locals .All the locals will be good.Only a proc without argument can modify the stack and align .
The method need a different pointer for functions arguments ,below soluce
xchg ebp,ebx ;prepare to adress an argument of function
mov eax,pg_matrix
xchg ebx,ebp ;prepare to adress a local variable