Using masm inline assembler on 64bit compiler, fails when I use the 32bit compiler

Using masm inline assembler on 64bit compiler, fails when I use the 32bit compiler

This is hard to figure out, help would be appreciated.

 have the following code segment compiling and linking and executes when I use the Intel Compiler 64bit version, however I get the following error when I use th 32bit compiler.I have included the switches also:

icpc -O2 -Wall -m32 -g3 -use-masm

error: label "RAX" was referenced but not defined, mov RAX, 0x1

compliation aborted (code 2)

unsigned long long regRAX = 0;

__asm

{

mov RAX, 0x1

CPUID

move regRAX, RAX

}

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You're trying to compile 64-bit assembler codes with 32-bit C++ compiler and, of course, it is Not supported. Here is a small example:

RTbool IsCPUFeaturePresent( RTuint uiRequestFeature )
{
RTuint uiFeatureRegCX = 0x0;
RTuint uiFeatureRegDX = 0x0;

__try
{
_asm
{
MOV eax, 1
CPUID
MOV uiFeatureRegCX, ecx
MOV uiFeatureRegDX, edx
}
}
...

Leave a Comment

Please sign in to add a comment. Not a member? Join today