News:

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

Convert symbol passed from command line

Started by vid, November 10, 2010, 07:36:16 PM

Previous topic - Next topic

vid

I am trying to include symbol passed from command line as string in my app. For example, app is compiled with:
ml /DREVISION=135M ...

Now in my code I'd like to do something like
db MakeString(REVISION), 0
(of course I just made that MakeString up), and get same thing as I'd get with
db "135M", 0

How to do this in MASM?

dedndave

well - the symbol is essentially an EQUate - rather than defined data (as with DB)
try this
.data?
LabelName db 4 dup(?)
.code
        mov     LabelName,REVISION

then, you can reference LabelName
you may want to make it 5 bytes and add a null terminator   :P

that will work for numeric values
i am not sure how to go about it for a TEXTEQUate

jj2007

This works:

ml.exe /DMyVersion=Hello

.code
tmp$ CATSTR <print ">, MyVersion, <", 13, 10>
tmp$

vid