Re: Driver sample with *.asm source

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Dont worry about useless using of assembler, using of this one *.asm among
other 20 *.c is in this case needed.
Many times I worked with *.cod files,
I only fear that in *.asm source must be used some mysterious MASM
directives or other thing, because it is part of driver.
Yesterday I created one sample function in *.asm and successfuly linked into
driver and it was runnable.
Before definition of function I used only:
..386
..model flat, stdcall
..code
....
MyFunction

But like I mentioned it seems that all these directives are sufficient, but
I am not 100% sure about it, even if this part of code is really functional
in result NDIS IM driver. In *.cod file are much more directives, I am not so
good in MASM to know what of these I must to use also in *.asm source file.
It would be suitable to publish some sample driver with source.asm in it,
mainly when inline assembler will not be supported in the future.

Thanks !
Peter

"Gary G. Little" wrote:

Cripes, if you want to see assembly used in a driver, simple set
"USER_C_FLAGS = -FAcs" in your sources file and then load the resulting .COD
file in to your editor du jour. Some variation of -FAcs will give you the
assembly language itself if you don't want the pesky C.

The question is why do you want to do this? Nearly every reason I have seen
for using assembly in the kernel has proven to be falacious and mostly a
result of a severe misunderstanding of kernel mode. If the thread Ali
references is the one I'm thinking of, it was started by a kinder-gartner
who thought assembly was much more elegant than C. Unfortunately, those of
us who started when only assembly was available for programming anything,
unless you wanted to use COBOL, laughed our asses off.

--
The personal opinion of
Gary G. Little

"Ali" <abdulrazaq@xxxxxxxxx> wrote in message
news:1149782340.556257.151420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Peter wrote:
Can I find somewhere *.sys driver sample which uses minimally one *.asm
source and for it's compilation is used MASM ?

Peter

I remember reading an article for asm driver but can't find it now,
it might be possible that site admin has removed that article.
The details of that article are given below hope you can search it on
web;-)


Name: Kernel Mode Driver Tutorial for MASM32 Programmers - Part 1 -
The Basics Abstract Four-F
URL:http://www.assembly-journal.com/index.php

ali




.



Relevant Pages

  • Re: HLA v2.x and / or LASM suggestion: Win32 Resources
    ... Assembler" probably always get when people are actually talking about ... machine_ from ASM or even some of the more "low-level" C programming - ... "Abstraction" - as I keep saying and, one day, I Hope people will ... writing code thinking it's "portable" when, in fact, it contains ...
    (alt.lang.asm)
  • Re: How to call function from driver in inline assembler
    ... but with all the driver issues floating around with Vista ... What assembler reference are you using in writting inline _asm code on ... of calling through it. ...
    (microsoft.public.development.device.drivers)
  • Re: What micros do you actually hate to work with?
    ... with less than tiny asm ... hassle to work with 32 bit longs in assembler for an 8 bit uP, ... Microchip's C compiler tools and their assembly under MPLAB. ... In this case, also, I was the only programmer. ...
    (comp.arch.embedded)
  • Re: Why use assembly?
    ... I use asm because, when given a propper tool, like RosAsm, its simply the easiest, clearest language. ... that learning asm with some of the older assembler may actually be a pain in the ass. ... The remaining bits that are not easy, comes from situations like when you have to write your own code for things that just take a single line of code in a HLL. ... Becomming an asm programmer is to take the step from beeing a servant in the dark to beeing the master of your own destiny in the programming world. ...
    (alt.lang.asm)
  • Re: What micros do you actually hate to work with?
    ... with less than tiny asm ... hassle to work with 32 bit longs in assembler for an 8 bit uP, ... Microchip's C compiler tools and their assembly under MPLAB. ... After writing a nicely designed equivalent in C, ...
    (comp.arch.embedded)