asm();

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Googles

asm();

Post 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!
Googles

Re:asm();

Post by Googles »

Solved it:

Code: Select all

           ULONG CPUID_Result=0;   
           asm ("movl $1,%%eax;cpuid;"
           :"=a"(CPUID_Result)
           : //Ingen input!
           :"%ebx","%ecx","%edx");
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:asm();

Post by bubach »

OT:
//Ingen input!
hehe, svensk?
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Googles

Re:asm();

Post by Googles »

jepp
Post Reply