NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: nobody on February 21, 2005, 09:44:40 PM
-
try doing this
%ifnnum -1
%error "-1 is not a number."
%endif
-
Yeah, Nasm's a little brain-dead on this issue - just looks to see if the *first* character's a decimal digit. The "workaround" is to use "0-1" - kinda ugly, but you get used to it :)
We may get that fixed... someday... it's easy to get used to, honest! (if it wasn't, I suppose it would have been fixed by now :)
Best,
Frank
-
> Yeah, Nasm's a little brain-dead on this issue
No, it isn't. Instead the NASM preprocessor is
behaving as expected. The term "-1" consists of
two tokens, "-" and "1". And "-" isn't a number.
> We may get that fixed
Doing so would break the preprocessor's logic.
As well as backwards compatibility.
-
0y is also a number for nasm's preprocessor.
Very its preprocessor's logic is quite other than its assembler's logic.
%ifnum 0y
%error 0y is a number
%endif