(sorry…forget paste the titile)
Hello
I used embedded assembler in my program,
Now I need to write that in C.
(these code is used to get CPU temperature)
__asm is:
//CPUID command
proint CPUInfo[4] = {-1};
__asm {
mov eax, 0
cpuid
mov CPUInfo[0],eax
mov CPUInfo[1],ebx
mov CPUInfo[2],ecx
mov CPUInfo[3],edx
}
//read MSR to get temperature data
int Delta;
__asm {
mov ecx, 0x19c
rdmsr
mov Delta,eax
}
My problem is:
1 I can use __cpuid to instead cpuid asm, it can run in VS2005,
But in VC6,I add Header file <intrin.h>,still it can not be compiled.
To solve this problem,shall I upgrade VC6 or…?
2 Shall I use Intrinsic Function readmsr to instead rdmsr asm?
In this case __readmsr’s parameter “register” is filled with the value of
ECX(0x19c)?
Any help is appreciated.
Thanks
Best Regards
frank</intrin.h>
Use a new compiler bc6 is ancient
d
dent from a phpne with no keynoard
-----Original Message-----
From: xxxxx@yahoo.com.cn
Sent: August 26, 2010 7:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] cpuid readmsr problem
(sorry…forget paste the titile)
Hello
I used embedded assembler in my program,
Now I need to write that in C.
(these code is used to get CPU temperature)
__asm is:
//CPUID command
proint CPUInfo[4] = {-1};
__asm {
mov eax, 0
cpuid
mov CPUInfo[0],eax
mov CPUInfo[1],ebx
mov CPUInfo[2],ecx
mov CPUInfo[3],edx
}
//read MSR to get temperature data
int Delta;
asm {
mov ecx, 0x19c
rdmsr
mov Delta,eax
}
My problem is:
1 I can use cpuid to instead cpuid asm, it can run in VS2005,
But in VC6,I add Header file <intrin.h>,still it can not be compiled.
To solve this problem,shall I upgrade VC6 or…?
2 Shall I use Intrinsic Function readmsr to instead rdmsr asm?
In this case __readmsr’s parameter “register” is filled with the value of
ECX(0x19c)?
Any help is appreciated.
Thanks
Best Regards
frank
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</intrin.h>
xxxxx@yahoo.com.cn wrote:
I used embedded assembler in my program,
Now I need to write that in C.
(these code is used to get CPU temperature)
…
My problem is:
1 I can use __cpuid to instead cpuid asm, it can run in VS2005,
But in VC6,I add Header file <intrin.h>,still it can not be compiled.
> To solve this problem,shall I upgrade VC6 or…?
Do you know when VC6 was released? 1997. We were still running Windows
95 at that point. If you don’t trust Windows 95 to run your computer,
why on earth would you trust a 13-year-old development tool to create
your programs?
> 2 Shall I use Intrinsic Function readmsr to instead rdmsr asm?
> In this case __readmsr’s parameter “register” is filled with the value of
> ECX(0x19c)?
You didn’t really need to ask this question, did you? Is there any
other POSSIBLE interpretation that makes sense? If you had just written
a simple program like this:
#include <intrin.h>
int x() { return__readmsr(0x19c); }
then compiled it and looked at the assembler output (/FAsc), you could
have answered this much more quickly than waiting for this list to respond.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.</intrin.h></intrin.h>
On 8/26/2010 6:32 PM, Tim Roberts wrote:
If you had just written a simple program like this […]
OP nor can do. OP is push-button wizard.
Useful content in this mail:
http://catb.org/esr/faqs/smart-questions.html