Created
March 25, 2013 09:02
-
-
Save zyxar/5235827 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <inttypes.h> | |
static inline void | |
vidcpu() | |
{ uint32_t v0=0; | |
uint32_t v1=0; | |
asm volatile ("pushf\n" | |
"popl %0\n" | |
"movl %0, %1\n" | |
"xorl $0x00200000, %0\n" | |
"pushl %0\n" | |
"popf\n" | |
"pushf\n" | |
"popl %0\n" | |
: "=a" (v0), "=d" (v1) | |
: | |
: "cc"); | |
printf("eax=%08x\nebx=%08x\n", v0, v1); | |
} | |
int main(int argc, char** argv){ | |
vidcpu(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment