Page 1 of 1

asm();

Posted: Thu Dec 23, 2004 12:59 pm
by Googles
What's wrong with this (in GCC):

ULONG CPUID_Result=0;
asm ("movl $1,%%eax;cpuid;"
:"=a"(CPUID_Result)
: //Ingen input!
:"%eax","%ebx","%ecx","%edx");

All I want to do is call CPUID with EAX=1 and have to result stored in
CPUID_Result!

Re:asm();

Posted: Thu Dec 23, 2004 4:18 pm
by Googles
Solved it:

Code: Select all

           ULONG CPUID_Result=0;   
           asm ("movl $1,%%eax;cpuid;"
           :"=a"(CPUID_Result)
           : //Ingen input!
           :"%ebx","%ecx","%edx");

Re:asm();

Posted: Sun Dec 26, 2004 3:07 pm
by bubach
OT:
//Ingen input!
hehe, svensk?

Re:asm();

Posted: Wed Dec 29, 2004 5:58 am
by Googles
jepp