#include static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { *eax = op; *ecx = 0; asm("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (*eax), "2" (*ecx)); } int main(voi...
by shenxiaocheng - Linux文档专区 - 2008-12-11 17:30:46 阅读(546) 回复(0)
cpuid指令 1. cpuid指令代码: 0a20f 例: { cpuid MACRO dw 0a20fh ENDM } 2. cpuid有效检测 如果程序可以改变EFLAGE(扩展标志字)的第21位,那么cpuid有效, 否则无效。 注:对于Cyrix的CPU,在打开其内部cpuid标志位之前,用此方法检测 无效。 例: { ... pushfd pop eax mov ecx,eax xor eax,200000h ;强制扩展标志位第...
#include int main(int argc, char* argv[]) { unsigned long s1,s2,s3,s4; char sel; printf("Select the function:\n1-------Read CPU id.\n2-------Disable CPU id.\n"); sel=getchar(); switch(sel) { case '1': asm volatile ( "movl $0x01 , %%eax ; \n\t...
#include stdio.h> int main(void) { unsigned int eax = 0, edx = 0, ecx = 0; asm volatile ("cpuid" : "=a"(eax), "=d"(edx) : "a"(0x01) ); if (edx & (1 17)) { /* edx输出中间32位的序列号,ecx输出最低32位的序列号 */ asm volatile ("cpuid" ...
#include stdio.h> int main(void) { unsigned int eax = 0, edx = 0, ecx = 0; asm volatile ("cpuid" : "=a"(eax), "=d"(edx) : "a"(0x01) ); if (edx & (1 17)) { /* edx输出中间32位的序列号,ecx输出最低32位的序列号 */ asm volatile ("cpuid" ...
#include stdio.h> int main(void) { unsigned int eax = 0, edx = 0, ecx = 0; asm volatile ("cpuid" : "=a"(eax), "=d"(edx) : "a"(0x01) ); if (edx & (1 17)) { /* edx输出中间32位的序列号,ecx输出最低32位的序列号 */ asm volatile ("cpuid" ...
1、3年以上的delphi方面的开发经验 2、熟练使用Sybase 3、具有良好的学习钻研能力 4、能够承担工作压力, 善于沟通,具有团队合作精神 我们将为您提供极具竞争力的工资、良好的福利保障体系。 有意者请将中文简历以Word附件形式Mail至[email]dlzp@use.com.cn[/email],请注明应聘职位编号。 [ 本帖最后由 UFIDA-DL 于 2008-5-30 11:36 编辑 ]