Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.2 KB

getcallerseflags.md

File metadata and controls

77 lines (56 loc) · 1.2 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: __getcallerseflags
__getcallerseflags
09/02/2019
_getcallerseflags
_getcallerseflags_cpp
_getcallerseflags intrinsic
2386596f-33aa-4cc7-b026-5a834637270a

__getcallerseflags

Microsoft Specific

Returns the EFLAGS value from the caller's context.

Syntax

unsigned int __getcallerseflags(void);

Return value

EFLAGS value from the caller's context.

Requirements

Intrinsic Architecture
__getcallerseflags x86, x64

Header file <intrin.h>

Remarks

This routine is only available as an intrinsic.

Example

// getcallerseflags.cpp
// processor: x86, x64

#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(__getcallerseflags)

unsigned int g()
{
    unsigned int EFLAGS = __getcallerseflags();
    printf_s("EFLAGS 0x%x\n", EFLAGS);
    return EFLAGS;
}
unsigned int f()
{
    return g();
}

int main()
{
    unsigned int i;
    i = f();
    i = g();
    return 0;
}
EFLAGS 0x202
EFLAGS 0x206

END Microsoft Specific

See also

Compiler intrinsics