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>
Well, that explains why you are asking about __out/__in, you are not using
the WDK BUILD, or DDKBUILD, to build your driver, are you?
Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com.cn
Sent: Thursday, August 26, 2010 9:48 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] __
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>
> 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…?
Are you writing the kernel mode code? then forget VC6 and use WDK.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com</intrin.h>