NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Structure on February 02, 2020, 09:18:14 PM

Title: Determine Parameter Type
Post by: Structure on February 02, 2020, 09:18:14 PM
How can i find out the parameter type passed to a macro...

Code: [Select]
runMacro dbString
Code: [Select]
runMacro "string"
I believe the compiler recognizes both of these as strings?
How can i differentiate between these two and run different commands based on that ?
Title: Re: Determine Parameter Type
Post by: debs3759 on February 03, 2020, 12:15:15 AM
If dbString is defined as

#define dbString "string"

or

dbString db "string"

then the two will be seen as the same when assembled. I am not aware of a way for the two to be differentiated with the two lines you posted. This is because the preprocessor substitutes "string" where it sees dbString.