分享方式:


__getcallerseflags

Microsoft 特定的

從呼叫端的內容傳回 EFLAGS 值。

語法

unsigned int __getcallerseflags(void);

傳回值

來自呼叫端內容的 EFLAGS 值。

需求

內建 架構
__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

END Microsoft 特定的

另請參閱

編譯器內建函式