From: Sathyanarayanan on
I badly need to use some assembly instructions in my driver & application.
Compiling these codes with _asm keyword works fine for x86, but throws error
for x64 & IA64. Then I learnt that _asm is not supported keyword for these 2
architectures. How else can I call assembly instructions that can work for
these architectures???
--
++Sathya
From: Don Burn on
You will have to get assemblers for these architectures and put the
instructions in seperate routines. I am very curious what instructions you
think you need?


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Sathyanarayanan" <Sathyanarayanan(a)discussions.microsoft.com> wrote in
message news:E114DFE3-EA38-4421-812F-B451C3068C01(a)microsoft.com...
>I badly need to use some assembly instructions in my driver & application.
> Compiling these codes with _asm keyword works fine for x86, but throws
> error
> for x64 & IA64. Then I learnt that _asm is not supported keyword for these
> 2
> architectures. How else can I call assembly instructions that can work for
> these architectures???
> --
> ++Sathya


From: Maxim S. Shatskih on
You cannot use any assembler instructions on X64.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim(a)storagecraft.com
http://www.storagecraft.com

"Sathyanarayanan" <Sathyanarayanan(a)discussions.microsoft.com> wrote in message
news:E114DFE3-EA38-4421-812F-B451C3068C01(a)microsoft.com...
> I badly need to use some assembly instructions in my driver & application.
> Compiling these codes with _asm keyword works fine for x86, but throws error
> for x64 & IA64. Then I learnt that _asm is not supported keyword for these 2
> architectures. How else can I call assembly instructions that can work for
> these architectures???
> --
> ++Sathya

From: Skywing on
You can put your assembler in a separate raw assembler module and link the
resultant object file in. There are also a great many new intrinsics
supported by the x64 compiler (e.g. _writecr0) to do some things you used to
need inline asm for.

(Certainly, you should avoid assembler in NT drivers where possible - but
there are a couple of legitimate scenarios where it is necessary.)

"Maxim S. Shatskih" <maxim(a)storagecraft.com> wrote in message
news:OaIxw1kNGHA.720(a)TK2MSFTNGP14.phx.gbl...
> You cannot use any assembler instructions on X64.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim(a)storagecraft.com
> http://www.storagecraft.com
>
> "Sathyanarayanan" <Sathyanarayanan(a)discussions.microsoft.com> wrote in
> message
> news:E114DFE3-EA38-4421-812F-B451C3068C01(a)microsoft.com...
>> I badly need to use some assembly instructions in my driver &
>> application.
>> Compiling these codes with _asm keyword works fine for x86, but throws
>> error
>> for x64 & IA64. Then I learnt that _asm is not supported keyword for
>> these 2
>> architectures. How else can I call assembly instructions that can work
>> for
>> these architectures???
>> --
>> ++Sathya
>


From: Sathyanarayanan on
I needed to read few MSRs of CPU, for which I had to use assembly code.

----- contents of assembly.asm ------
..model SMALL, C
..686P
..code
ReadCPUMsr PROC PUBLIC MsrAddr:DWORD
push ecx
mov ecx, MsrAddr
rdmsr
pop ecx
ret
ReadCPUMsr ENDP
End
----- contents assembly ends --------

1. When i compile this .asm file separately in makefile.inc (ml /c /Cx /coff
/Fo$(O)\assembly.obj assembly.asm) it generates .obj, but I didn't know how
to instruct BUILD utility to link this obj file along with my driver code -
any inputs?
2. Alternately, I tried to include this .asm file name under SOURCES macro
in sources file, but NMAKE returns error "NMAKE : fatal error U1073: don't
know how to make 'objchk_wnet_x86\i386\assembly.obj'

How do I successfully link my driver code with this assembly?
--
++Sathya


"Skywing" wrote:

> You can put your assembler in a separate raw assembler module and link the
> resultant object file in. There are also a great many new intrinsics
> supported by the x64 compiler (e.g. _writecr0) to do some things you used to
> need inline asm for.
>
> (Certainly, you should avoid assembler in NT drivers where possible - but
> there are a couple of legitimate scenarios where it is necessary.)
>
> "Maxim S. Shatskih" <maxim(a)storagecraft.com> wrote in message
> news:OaIxw1kNGHA.720(a)TK2MSFTNGP14.phx.gbl...
> > You cannot use any assembler instructions on X64.
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim(a)storagecraft.com
> > http://www.storagecraft.com
> >
> > "Sathyanarayanan" <Sathyanarayanan(a)discussions.microsoft.com> wrote in
> > message
> > news:E114DFE3-EA38-4421-812F-B451C3068C01(a)microsoft.com...
> >> I badly need to use some assembly instructions in my driver &
> >> application.
> >> Compiling these codes with _asm keyword works fine for x86, but throws
> >> error
> >> for x64 & IA64. Then I learnt that _asm is not supported keyword for
> >> these 2
> >> architectures. How else can I call assembly instructions that can work
> >> for
> >> these architectures???
> >> --
> >> ++Sathya
> >
>
>
>