Re: No Inline-Assembly for x64 Builds?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



It does, but what possible good would it do? As I said, no self-respecting driver writer
would think that assembly code made sense in a device driver. Perhaps you are thinking
"MS-DOS Device Drivers". Modern device drivers don't use it. They haven't used it since
the release of 32-bit Windows.

The latest numbers I heard were that of the many millions of lines of code in the Windows
kernel, there are only about 15K lines of assembly code, and those exist only at the
lowest level interfaces to the hardware. Device drivers do not live at that level (I
co-authored a book and course on writing device drivers, and teach that course today, and
I've not seen a driver that needed assembly code, or found any reason that a programmer
would ever need to actually write it).

Most assembly code deals with using the MMX instructions, and they cannot be used
effectively in the kernel (in general, it costs more to set up to use them than they would
typically save)
joe

On Mon, 23 Feb 2009 23:47:57 -0800, "boris" <somewhere@xxxxxxxxxxx> wrote:


"boris" <somewhere@xxxxxxxxxxx> wrote in message
news:49a3a589$0$1609$742ec2ed@xxxxxxxxxxxxxxxxx
"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
wrote in message news:O1fsfkklJHA.4760@xxxxxxxxxxxxxxxxxxxxxxx
Kerem Gümrükcü wrote:
Hi,

am i right when i remember that Visual C++ 2008
has NO support for x64 Assembly Instructions. But
what if i want or even have to write some assembly
code and want to use it in my x64 Code? What then?
I have some C-Dlls that are 32Bit and they use some
32Bit Assembly Language. So if the __asm is no more
for x64, how can i include it anyway into my Dll's? Do
i have to work with external x64 Assembler and then link
object code to my VC++ Dll, or is there any other "Inline"
Method i can use?

No, there's no other way. If you need x64 assembly, you have to author a
separate assembly-only module, assemble it with ml64 and link it into
your DLL/EXE.
What about WDK: does it support inline assembly?
I meant inline x64 assembly.
Does WDK support it?

Boris

Boris
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Good example of C and MACRO
    ... really necessary is when you are bootstrapping a new hardware platform. ... Even device drivers are now written in C. ... Not every CPU instruction has an equivalent HL construct. ... the only place where assembler makes sense is where you are way outside the Calling Standard doing argument shuffling. ...
    (comp.os.vms)
  • Re: Embedding assembler in a language
    ... assembler as a "backdoor." ... the second time I *really* wante to use assembly, not just within an HLL, ... I've only used one HLL language where you don't have to use ... It's only for low-level stuff (an OS, device drivers, ...
    (comp.lang.misc)
  • Re: No Inline-Assembly for x64 Builds?
    ... There's no reason for assembly code in device drivers, ... i have to work with external x64 Assembler and then link ...
    (microsoft.public.vc.mfc)
  • Re: Good example of C and MACRO
    ... Assembler language programming is just about dead. ... really necessary is when you are bootstrapping a new hardware platform. ... Even device drivers are now written in C. ...
    (comp.os.vms)
  • Re: Static Libraries and Assembly Language
    ... The "static libraries" is one of methods to fabricate that. ... syntax, you can choose to translate it to syntax of your assembler, ... Usage of a DLL is good thing as long as this DLL is common and is used widely. ... The point was about utilizing of assembly code among different assembly ...
    (alt.lang.asm)