Format
#include <builtin.h>void __setCPUFlags(unsigned int flags)
Language Level: None
__setCPUFlags sets the cpu's EFLAGS register to the value of flags.
The builtin.h header file provides defines for each of the bits
within the EFLAGS register. __getCPUFlags should be used to get
the value of the bits you don't want to change. Refer to the Intel
Programmer's Reference manual for further information
regarding the EFLAGS register.
Return Value
There is no return value from this function.
Example
This example sets the zero flag in the cpu's EFLAGS
register.
#include <stdio.h> #include <builtin.h>
int main(void)
{
unsigned int flags = __getCPUFlags();
/* Set the zero flag. */ flags |= _zf;
__setCPUFlags(flags);
printf("The cpu flags are now %.8x\n", flags);
/***************************************
The output should be similar to:
The cpu flags are now 00000256 ***************************************/
return 0; }
![]()
__getCPUFlags -- Get Value of EFLAGS
Register