It is surprising how horribly bad the documentation is.
I'm constrained to using MASM for external reasons.
name DWORD 30 DUP (1)
initializes 30 DWORDs to the value 1. I keep discovering these things by reading the MASM
listings produced by the compiler, and that triggers memories of what I used to do twenty
years ago.
I have the DDK MASM package, and its documents suck.
The command line switches are actually defined in the documentation. Nothing else of
value is defined.
MASM doesn't support Unicode, and I even have a slide that points this out; it has to be
hello DB 'H', 00h, 'E', 00h, 'L', 00h, 'L', 00h, 'O', 00h, 00h, 00h
I can see why companies are having problems finding people who can program in assembler.
When you can't learn how something works, you won't use it.
But now they're paying the price: people who need super-high-performance and want to use
the fancy MMX/XMM/etc instructions can't figure out how to use them or write them;
security companies can't get people who can reverese-engineer viruses, etc. And some of
these people need to write code that doesn't run with a C-stack or use the normal stack
while doing virus intercepts and cleanup. The number of us who used to earn our livings
writing huge systems in assembly code (250K lines) is dwindling...
I don't really believe in writing more that tiny subroutines in assembler, but what I seem
to take for granted--how to write assembly code--is apparently becoming a lost art.
Also, it turns out, compiler writers need to know how to program in machine code so they
can write code-generation components. I found someone who was writing a "compiler" for
XXXX-to-x86, where XXXX is the binary executable format for a long-dead computer (I can't
say more, such as who, but emulation is becoming a Big Deal all of a sudden, as long-lost
dusty-deck binaries are being sought out to do things like data reduction on massive
datasets (multi-GB). So opportunity is not just knocking; it is trying to break my door
down.
I thought writing a course in using MASM would be easy. It probably would be, if there
were any documentation. Right now, I have to run experiments. Sad, really. The syntax
of an identifier is apparently a Microsoft Corporate Secret.
joe
Post by GeoffOn Fri, 13 Nov 2009 12:03:27 -0500, Joseph M. Newcomer
Post by Joseph M. NewcomerHas anyone ever encountered the documentation for MASM. Not the useless garbage in the
MSDN, but real documentation. THe kind that gives the syntax of identifiers, for example,
or explains what options are available with the OPTIONS directive (not just a list of
them, but the actual explanations)? Or the syntax of a string, or of an initializer?
I'm reverse-engineering some of this as I am designing a course in x86 assembly code
(really! Turns out people need to *read* it), but I'd be happier if I found real
documentation somewhere.
The last time I wrote assembler it was for a device driver in MS-DOS, in 1989. But
apparently some things never go away, such as the need to know it, but nobody teaches it
any longer.
joe
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
The documentation for MASM from Microsoft was always rather poor IMHO,
compared to their documentation effort on the C/C++ front. The hard
copy manuals that came with MASM 5.1 and 6 were all about the tools
like ilink and dumpbin and not about MASM commands or ML itself.
Nothing existed online at the time and the help files in the MASM 6.11
package are MS-DOS help files. Most of the "help" available at the
time was in the form of sample files, IIRC. The MASM CLI was
"documented" in the "ml /h" command. I recall the /Zi switch was the
command to make MASM generate a CodeView debuggable binary.
The documentation might be improved in the MASM 8.0 package.
I encourage you to check out MASM32, a freeware development system
built around the Microsoft MASM package. http://www.masm32.com/
The masm32 package is intriguing because of it's "invoke" operator, a
tool that allows Windows API functions to be called in one line macros
and their return codes to be recovered in another line.
As for strings, I don't know any way MASM did it other than
.data
MyString db "This is a string",0
and this has obvious deficiencies with respect to Unicode. As I recall
the MASM 5/6 documentation also had sections on interfacing to BASIC
and FORTRAN code. I have not tested what would happen if you did
MyString dd "This is a string",0 instead.
I'm not sure what you mean by initializer in this context. A variable
.data
align 4
x DWORD 10 ; initialized
y DWORD ? ; uninitialized
POINT STRUCT
x DWORD ?
y DWORD ?
POINT ENDS
All MASM versions were backward compatible with older versions so an
8.0 MASM would still be capable of generating Win16 code.
I always had the feeling that MASM was one of those tools that was
provided by Microsoft as an afterthought "Oh, you need an assembler?
Yeah, we have one, here it is. Have fun."
The MASM 8.0 package was provided as an addend to the VS 2005 package
and I don't know if the VS IDE has carnal knowledge of the CLI of MASM
but it would seem so.
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm