Remarks
The compiler provides a symbol, __LOCAL_SIZE, for use in the inline assembler block of function prolog code. This symbol is used to allocate space for local variables on the stack frame in your custom prolog code.
The compiler determines the value of __LOCAL_SIZE. Its value is the total number of bytes of all user-defined locals as well as compiler-generated temporary variables. __LOCAL_SIZE can be used as an immediate operand; it cannot be used in an expression. You must not change or redefine the value of this symbol. For example:
mov eax, __LOCAL_SIZE ;Immediate operand
mov eax, [ebp - __LOCAL_SIZE] ;Expression
The following is a example of a naked function containing custom prolog and epilog sequences using the __LOCAL_SIZE symbol in the prolog sequence:
__declspec ( naked ) func()
{
int i;
int j;
_asm /* prolog */
{
push ebp
mov ebp, esp
sub esp, __LOCAL_SIZE
}
/* Function body */
__asm /* epilog */
{
mov esp, ebp
pop ebp
ret
}
}
For related information, see naked in the Language Quick Reference.