Static class data in inline assembly

Static class data in inline assembly

Hi,

I seem to be unable to access static class data from within an inline assembly block. Here's an example that reproduces the problem:

class Foo
{
	static int data;

	void Bar()
	{
		__asm
		{
			mov eax, data
		}
	}
};

It compiles with the Visual Studio .NET 2003 compiler but not with Intel C++ Compiler. I could not find any workaround other than placing the static data declaration within the function body. However, this creates another problem since I need several static variables successively in memory.

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

Anyone know how to make the compiler store static variables consecutively? The only method I found so far is to use arrays but I'd like to use different variable names for every element.

Thanks!

It seems that it doesn't work with the 7.1 version. But it compiles fine with 8.0. But the 8.0 beta period is over now, please wait for the 8.0 which will be released early Dec. this year.

Or if you'd like it in 7.1, could you please submit an issue to Premier Support? See the ReleaseNotes on how to submit issues.

Thanks very much,
Jennifer

Leave a Comment

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