Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7568 Discussions

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

Mike_Korzenowski
Beginner
99 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
99 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 } } ...
Reply