flat assembler
Message board for the users of flat assembler.
Index
> Main > Declaring string constants |
Author |
|
Tomasz Grysztar 15 Feb 2012, 00:02
fasm has two separate languages on top of each other: the preprocessor and then the assembler. "equ" is a preprocessor's directive, so when you define "OS_VERSION equ WinXP", then it replaces all the occurences of OS_VERSION with WinXP, so what assembler sees is:
Code: if WinXP = WinXP There is a couple of different solutions how you can make this work. You can define WinXP as a constant for assembler, so that it will recognize it: Code: OS_VERSION equ WinXP ; this is for preprocessor WinXP = 4 ; this is for assembler if OS_VERSION = WinXP ; after preprocessing this becomes "if WinXP=WinXP" ; ... Code: OS_VERSION equ WinXP match =WinXP, OS_VERSION { ; ... } Code: OS_VERSION equ WinXP
if WinXP eq WinXP
;... wyvern wrote: Another question related, can i define symbols from command line instead changing the values in the source? |
|||
15 Feb 2012, 00:02 |
|
wyvern 15 Feb 2012, 00:09
Oh , excelent help, thank you.
|
|||
15 Feb 2012, 00:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.