Share via


Naked Function Example

OverviewHow Do I

The following is a minimal example of a naked function containing custom prolog and epilog sequences:

__declspec ( naked ) func()
{
    int i;
    int j;

    _asm
        {
        push   ebp
        mov     ebp, esp
        sub     esp, __LOCAL_SIZE
        }

    /* C and/or _asm code */

    _asm
        {
        mov     esp, ebp
        pop     ebp
        ret
        }
}