Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

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

Mike_Korzenowski
Beginner
288 Views

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

}

0 Kudos
1 Reply
SergeyKostrov
Valued Contributor II
288 Views
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 } } ...
0 Kudos
Reply