News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Conditional assembly in FORC macro

Started by fonolite, September 07, 2010, 08:18:11 AM

Previous topic - Next topic

fonolite

FORC X , <08>

IF X EQ 0
ECHO Hey X
ENDIF

ENDM

=>
Hey 0



But,

FORC X , <0A8>

IF X EQ 0
ECHO Hey X
ENDIF

ENDM

=> Error A2116: Symbol not defined : A
X has 0 , A, 8 charaters in string.

I can't find a macro function like @strcmp(X,0)
to do boolean operaions.

What should I do conditional assembly inside FORC macro?

dedndave


japheth

Quote from: dedndave on September 07, 2010, 10:44:08 AM
try this...
FORC X , <0A8h>

This isn't much better.
During expansion of the macro, these lines (among others) will be created:

IF 0 EQ 0
IF A EQ 0
IF 8 EQ 0
IF h EQ 0

To make it work, one has to compare literals:


FORC X , <08>

IFIDN <X>, <0>
ECHO Hey X
ENDIF

ENDM