# file opened: issue35.asm
 1    0000                  MACRO MYMACRO1 addr, string, term
 2    0000 ~                    ld de,addr
 3    0000                  ENDM
 4    0000
 5    0000                  MACRO MYMACRO2 addr, string
 6    0000 ~                    ld de,addr
 7    0000                  ENDM
 8    0000
 9    0000                  MACRO MYMACRO3 _addr, _string, _term
10    0000 ~                    ld de,_addr
11    0000                  ENDM
12    0000
13    0000                  MACRO MYMACRO4 addr?, string?, term?
14    0000 ~                    ld de,addr?
15    0000                  ENDM
16    0000
17    0000                  ORG 0x1234
18    1234                  ; this will fail with "Label not found: test_result_1", because "string" sub-part is substitued with "1"
19    1234                  MYMACRO1 test_result_string, 1, 0   ; this is feature, not bug (see "macro_test.asm")
issue35.asm(2): error: Label not found: test_result_1
issue35.asm(19): ^ emitted from here
19    1234 11 00 00    >        ld de,test_result_1
20    1237
21    1237                  ; this will fail with "Label not found: test_result_1", because "string" sub-part is substitued with "1"
22    1237                  MYMACRO2 test_result_string, 1
issue35.asm(6): error: Label not found: test_result_1
issue35.asm(22): ^ emitted from here
22    1237 11 00 00    >        ld de,test_result_1
23    123A
24    123A                  ; this will not fail, since v1.11.2 the sjasmplus substitution rules were modified.
25    123A                  ; The macro arguments and define's names starting with underscore will prevent the in-middle substition
26    123A                  ; so the `_string` macro argument can substitute only whole `_string` term, but not at the end of `test_result_string`
27    123A                  MYMACRO3 test_result_string, 1, 0
27    123A 11 40 12    >        ld de,test_result_string
28    123D
29    123D                  ; this should work, and was suggested as fix to the Issue#35 reporter
30    123D                  MYMACRO4 test_result_string, 1, 0
30    123D 11 40 12    >        ld de,test_result_string
31    1240
32    1240 00           test_result_string: defb 0
33    1241
# file closed: issue35.asm

Value    Label
------ - -----------------------------------------------------------
0x1240   test_result_string
