From: Don Burn on
You cannot use __asm in an x64 compiler it is not supported. For x64
use the _writemsr intrinsic function.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr



> -----Original Message-----
> From: dsrking [mailto:dsrking2006(a)gmail.com]
> Posted At: Monday, April 19, 2010 8:33 AM
> Posted To: microsoft.public.development.device.drivers
> Conversation: Assembly code in driver source with x64 build not
working
> Subject: Assembly code in driver source with x64 build not working
>
> Hi
>
> I need to read/write acpi registers using portio driver which is got
from
> WinDDK7600 version. I added some ASM code in my driver source for
read/write
> as follows,
>
>
------------------------------------------------------------------------
------
> -------------------------
> __asm
> {
> MOV ECX, Reg_Addr // address of the reg to be written
> MOV EAX, Value1 // First value to be written
> MOV EDX, Value2 // second value to be written
> WRMSR
> }
>
------------------------------------------------------------------------
------
> -------------------------
> Note: Reg_Addr, Value1,Value2 are inputs for this function.
>
> This is working in perfectly x86 build. But not working in x64 build.
> It shows errors like,
>
> __asm keyword not supported on this architecture.
> 'MOV' undeclared identifier,etc.,
>
> Could anybody explain how to solve this problem?
>
> Regards - D.
>
>
>
>
> __________ Information from ESET Smart Security, version of virus
signature
> database 5041 (20100419) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>