CPUID not supported???

The docs list cpuid as a valid inline assembly instruction however when I
try to compile it I get.

Error! E1156 Assembler error: Invalid instruction with current CPU setting

I tried adding -5r as an argument but this didn’t help.

here is the code.


long vendorID1;
long vendorID2;
long vendorID3;
long processorSignature;
long processorSerial1;
long processorSerial2;


extern getStats(void);
#pragma aux getIDStats =
“PUSH EAX”
“PUSH EBX”
“PUSH ECX”
“PUSH EDX”
“MOV EAX, 00H”
“cpuid”
“MOV vendorID1, EBX”
“MOV vendorID2, EDX”
“MOV vendorID3, ECX”
“MOV EAX, 01H”
“cpuid”
“MOV processorSignature, ECX”
“POP EAX”
“POP EBX”
“POP ECX”
“POP EDX”;






int main(int argc, char * argv[])
{

printf(“Getting CPU Stats\n”);

vendorID1 = 0;
vendorID2 = 0;
vendorID3 = 0;
processorSignature = 0;


getStats();

printf(“Vendor ID 1 : %x\n”, vendorID1);
printf(“Vendor ID 2 : %x\n”, vendorID2);
printf(“Vendor ID 3 : %x\n”, vendorID3);
printf(“Vendor ID 1 : %x\n”, processorSignature);


printf(“Done getting CPU Stats\n”);

return 1;

}


Suggestions???

Thanks to QNX support all that is required is “.586” as the first line in
the pragma.


“Paul Vander Byl” <paul@gandacar.ca> wrote in message
news:b1mnnu$15f$1@inn.qnx.com

The docs list cpuid as a valid inline assembly instruction however when I
try to compile it I get.

Error! E1156 Assembler error: Invalid instruction with current CPU setting

I tried adding -5r as an argument but this didn’t help.

here is the code.


long vendorID1;
long vendorID2;
long vendorID3;
long processorSignature;
long processorSerial1;
long processorSerial2;


extern getStats(void);
#pragma aux getIDStats =
“PUSH EAX”
“PUSH EBX”
“PUSH ECX”
“PUSH EDX”
“MOV EAX, 00H”
“cpuid”
“MOV vendorID1, EBX”
“MOV vendorID2, EDX”
“MOV vendorID3, ECX”
“MOV EAX, 01H”
“cpuid”
“MOV processorSignature, ECX”
“POP EAX”
“POP EBX”
“POP ECX”
“POP EDX”;






int main(int argc, char * argv[])
{

printf(“Getting CPU Stats\n”);

vendorID1 = 0;
vendorID2 = 0;
vendorID3 = 0;
processorSignature = 0;


getStats();

printf(“Vendor ID 1 : %x\n”, vendorID1);
printf(“Vendor ID 2 : %x\n”, vendorID2);
printf(“Vendor ID 3 : %x\n”, vendorID3);
printf(“Vendor ID 1 : %x\n”, processorSignature);


printf(“Done getting CPU Stats\n”);

return 1;

}


Suggestions???