Macro parameters are sometimes handled as values and sometimes as string. But the user has no control over it.
Example:
MAC TEST
.byte {1}
ENDM
_VAL SET 0
REPEAT 3
TEST _VAL
_VAL SET _VAL + 1
REPEND
This results into:
Now, if I want to do the same with a label, this doesn't work.
MAC TEST
Label{1}
ENDM
_VAL SET 10
TEST _VAL
Results into Label_VAL. But what I need is Label10,
And sometimes I even want both, value and string. E.g.
MAC TESTP
IF (>{1}) != (>{2})
ECHO {1}, "not on same page as", {2}
ENDIF
ENDM
Label1
.byte 1,2, 3
Label2
TESTP Label1, Label2
Here I want to print out the labels names, not the values.
Therefore it would be good if the user get some control over the output. Maybe similar to [value]d, which outputs a number as decimal. So [value]v would output as value (also [value]d as decimal value, not only in strings) and [value]s would output as string.
So my 2nd example from above would look like this:
MAC TEST
Label[{1}]d
ENDM
_VAL SET 10
TEST _VAL
And create Label10.
Macro parameters are sometimes handled as values and sometimes as string. But the user has no control over it.
Example:
This results into:
Now, if I want to do the same with a label, this doesn't work.
Results into
Label_VAL. But what I need isLabel10,And sometimes I even want both, value and string. E.g.
Here I want to print out the labels names, not the values.
Therefore it would be good if the user get some control over the output. Maybe similar to
[value]d, which outputs a number as decimal. So[value]vwould output as value (also[value]das decimal value, not only in strings) and[value]swould output as string.So my 2nd example from above would look like this:
And create Label10.