__getcallerseflags

Microsoft 专用

从调用方上下文中返回 EFLAGS 值。

语法

unsigned int __getcallerseflags(void);

返回值

调用方上下文中的 EFLAGS 值。

要求

Intrinsic 体系结构
__getcallerseflags x86、x64

头文件<intrin.h>

备注

此例程仅可用作内部函数。

示例

// 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

结束 Microsoft 专用

另请参阅

编译器内部函数