Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

64-bit registers not recognized by the compiler?

$
0
0

I have made a simple test program to try out inline assembly, as follows:

#include <stdio.h>

int main()
	{
		int a=0;

		__asm {
				mov eax, 1
				mov [a], eax
		}

		printf("%d", a);

		return 0;
	}

It builds and outputs 1 before exiting as it should. However, if I change "eax" to "rax" to access the full 64-bit register, building the program fails with the following error message from the compiler:

1>------ Build started: Project: test4, Configuration: Debug Win32 ------
1>Build started 2014-06-06 17:39:44.
1>InitializeBuildStatus:
1>  Creating "Debug\test4.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>MessageBuildingWithCompiler:
1>  Building with Intel(R) C++ Compiler XE 14.0
1>ClCompile:
1>  ***** ClCompile (Win32 - Intel C++)
1>  test4.cpp
1>test4.cpp(8): error : label "rax" was referenced but not defined
1>    				mov rax, 1
1>    				    ^
1>
1>  compilation aborted for test4.cpp (code 2)
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.10
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I am using Intel Composer XE 2013 SP1 Update 3 integrated into Visual Studio 2010. All compiler settings for this test project are at default. Anyone have any ideas what might be going on here? Could it be the Win32 part that should somehow be changed before 64-bits registers will be available?


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>