- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all.
The following snippet compiles fine using the MSVC 6 compiler, but doesn't using intel C++ 8 compiler.
I got these errors (both twice, so 4 errors...):
error: too many C symbol replacements in an assembly language instruction mov res.LowPart, eax
^
error: label "mov" was referenced but not defined
And this is the code:
static __inline LARGE_INTEGER _GetTicks( void )
{
LARGE_INTEGER res;
__asm {
RDTSC
mov res.HighPart, edx
mov res.LowPart, eax
}
return res;
}
How can I solve them??
Thanks
The following snippet compiles fine using the MSVC 6 compiler, but doesn't using intel C++ 8 compiler.
I got these errors (both twice, so 4 errors...):
error: too many C symbol replacements in an assembly language instruction mov res.LowPart, eax
^
error: label "mov" was referenced but not defined
And this is the code:
static __inline LARGE_INTEGER _GetTicks( void )
{
LARGE_INTEGER res;
__asm {
RDTSC
mov res.HighPart, edx
mov res.LowPart, eax
}
return res;
}
How can I solve them??
Thanks
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For Intel C++ 8.1 and 9.0, the Microsoft intrinsic
__rdtsc() is implemented. I don't know whether this depends on having the msvc7 library. It's supported in the MS C++ 2003 toolkit. Microsoft has obsoleted application use of asm{} for this purpose. I don't exactly when the corresponding change came into the various Intel 8.x compilers.
There is a small difference in the way this would work on the newer machines. Rather than tieing the counter to the CPU clock, as it used to do, the instruction returns a count of front side bus base clock, multiplied by the intended multiplier corresponding to the full clock speed of the chip. Thus, rdtsc() should continue to run proportional to front side bus speed, regardless of power saving adjustments to CPU speed.
__rdtsc() is implemented. I don't know whether this depends on having the msvc7 library. It's supported in the MS C++ 2003 toolkit. Microsoft has obsoleted application use of asm{} for this purpose. I don't exactly when the corresponding change came into the various Intel 8.x compilers.
There is a small difference in the way this would work on the newer machines. Rather than tieing the counter to the CPU clock, as it used to do, the instruction returns a count of front side bus base clock, multiplied by the intended multiplier corresponding to the full clock speed of the chip. Thus, rdtsc() should continue to run proportional to front side bus speed, regardless of power saving adjustments to CPU speed.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page