You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And also it is not possible to define "overloaded" version of macro. I.e. currently the precise amount of arguments has to be passed. You can create "default" variant with distinct-enough name by creating DEFINE test5 test 5 but as always with macros/defines, too much of these could cause lot of headache (especially if one is not familiar with checking listing files often, as the substitution rules are currently sometimes too powerful and confusing)
I'm not completely sure if I like this idea, because macros/defines are generally a bit fragile if people are not careful enough (for example - your example in this issue overshadows the Z80N instruction test :) ), but if I will ever start the work on v2.x, I will surely reconsider this, it's very tempting idea.
edit: but one thing is obvious.. the colon syntax is impossible in current v1.x sjasmplus, colon is hard line delimiter except when used as end of symbol name. But I guess there should be many other options, without checking for syntax details, maybe even assign would work, like macro test var=5.
I completely forgot about overloading...
but yeah it doesn't have to be a colon, as you said assign would work.
and yeah creating a macro for each needed variant could cause them to become disparate if they go through to many changes, and you forget to update each one, where as having a single macro with some default parameters makes for cleaner and simpler to maintain code.
Is your feature request related to a problem?
sjasm allows default values for macro parameters.
sjasmplus does not appear to, unless I've completely overlooked something.
sjasm
macro test var:5
LD C, var
endmacro
test
test 0
would output
LD C, 5
LD C, 0
Describe the suggested solution:
allow for default values for macro parameters.
or tell me how to use them if I've overlooked something.
I'm sorry if I've overlooked something and sjasmplus does allow default values for macro parameters, but I have yet to find out how to use them.
The text was updated successfully, but these errors were encountered: