I'm porting an old piece of code that contains assembly. It won't compile on x64 under Vis Studio 2010 with this error: nonstandard extension used '__asm' keyword not supported on this architecture x64
Having read a few other entries it's now clear to me I have to rewrite that code to be able to make it portable. I am having a tough go at porting one piece of the code. I could use some help. How would I rewrite this chunk to make it compile under x86 and x64?
unsigned tval= 0;
unsigned AXr, BXr, CXr, DXr;
_asm{
push eax
push ebx
push ecx
push edx
mov eax, tval
mov ebx, 0
mov ecx, 0
mov edx, 0
cpuid
mov AXr, eax
mov BXr, ebx
mov CXr, ecx
mov DXr, edx
pop edx
pop ecx
pop ebx
pop eax
}
Thanks much for the help!