Why can?t I use this directive in MASM32?

IFDEF masm32
option casemap :none

I get always a lot of erros due to this!

Thank you

S?rgio Oliveira
Posted on 2002-05-23 08:32:18 by Neptuno
Sorry, what I really write is this:

IFDEF masm
option casemap :none

(and not IFDEF masm32!!)
Posted on 2002-05-23 08:33:25 by Neptuno
Why would you need such a bit of code?
The syntax of masm is sufficiently different from TASM, NASM, SPASM, that I don't think you could ever use a different assembler on it!

Have you actually got a line in your assembler "masm EQU 1" above the IFDEF line?
Alternatively you could use ml /Dmasm=1 I think, or something similar...
If you don't define it, the windows.inc file will throw a wobbly because it was written with casemap:none in mind.

Posted on 2002-05-23 09:33:01 by Mirno

I?m using that just to try... :)

I made as you said... I write MASM equ 1 above and it worked... Why was that necessary? Isn?t masm equ 1 mean that masm = 1 (like a constant?). However if I make IFDEF masm... why the assembler doesn?t know what MASM is?

Thank you
Posted on 2002-05-23 10:41:51 by Neptuno

why the assembler doesn?t know what MASM is?
:grin: Can one ever truely know themself? :grin:
Posted on 2002-05-23 10:54:16 by bitRAKE
Its the name of the assembler... so its not a huge stretch to assume its a reserved variable of some sort.

Just change the name to something like:

$MASM, or @MASM, or _MASM_

%echo Masm Mode!
%Non Masm Mode!
Posted on 2002-05-23 10:54:48 by NaN

it?s because is the assembler name that I tought that too, and that is way I don?t understand why I need to make:

MASM equ 1

for this:

option casemap :none

to work.

Without "MASM equ 1" it doesn?t work :( This is what I don?t understand. I tried _MASM_ and the others you said, but I need to pu "MASM equ 1".
Posted on 2002-05-23 11:03:33 by Neptuno
Got me... all i can say then is MASM is not a reserved word, and it expects either OPTION code to unscoped, or, you must provide *some* OPTION casemap setting to begin with.

Im not familiar with any varients :rolleyes: , I *always* begin with:

.model flat,stdcall
option casemap:none
Posted on 2002-05-23 11:14:48 by NaN
MASM doesn't set a variable so you know its MASM assembling. It is not a valuable feature of the assembler, the syntax is different enough such that in order to use MASM it must have been written for MASM.

It isn't like C where there are 100 compilers out there all fully conformat with the ANSI C standard.

The best way to do what you want is to use the /D command I think, so modify the build make file you use (or the Makefile) so you have:
ml ... /Dmasm=1 ...

That way it is transparent to your file.
It is also a good way for doing debug builds, having two make rules, one with /DDEBUG=1 and one without.

Posted on 2002-05-23 11:19:01 by Mirno
I understood :) It?s like in visual basic. The point is not the name of the variable but the value in it. "masm" is not recognized by the assembler, it?s just a variable... The problem is that the name of the variable confused me :)

Posted on 2002-05-23 12:37:35 by Neptuno