Does anyone know of a technique I can use to get the parameters to replace substrings inside macros instead of complete words?
I had two instances were I would have liked to do this.
1) To generate two different labels for each macro using just one parameter:
This macro would then be invoked as:
If you call this macro twice the compilation fails because of duplicate labels named "label_1:" and "label_2:"
2) So that I could use symbols for byte and bit variables in my macro instead of hard coding the byte or bit variable names
This macro would then be invoked as:
I had two instances were I would have liked to do this.
1) To generate two different labels for each macro using just one parameter:
Code:
#MACRO macro#1(label, variable)
if variable > 1 then goto label_1
<some code>
goto label_2
label_1:
<some more code>
label_2:
##ENDMACRO
Code:
macro#1(case1, b0)
2) So that I could use symbols for byte and bit variables in my macro instead of hard coding the byte or bit variable names
Code:
symbol TEMP_BYTE_B0 = b0 ; B0 is used as a global TEMP variable
symbol TEMP_BYTE_B0.5 = bit5
#MACRO macro#2(label, variable, )
if variable.5 > 1 then goto label
variable = variable * 2
label:
##ENDMACRO
Code:
macro#2(bit5_check1, TEMP_BYTE_B0)