5.4.3 Macro operator

This section describes the combination symbols "~" and "$", which are used to link strings in macros.

(1)

∼ (Concatenation)

-

The concatenation symbol concatenates "strings composed of numbers and characters similar to alphabet" with each other within a macro body.
At macro expansion, the "strings" on the left and right sides of the concatenation symbol are concatenated and the concatenation symbol itself disappears after concatenating the strings.

-

The concatenation symbol replaces formal parameters with arguments before concatenation.

-

The character "~" can only be used as a combination symbol in a macro definition.

-

The "∼" in a character string and comment is simply handled as data.

Example 1.

abc     .macro  x
        abc~x:  mov     r10, r20
                sub def~x, r20
.endm
abc STU
[Development result]
abcSTU: mov     r10, r20
        sub     defSTU, r20

Example 2.

abc     .macro  x, xy
        a_~xy:  mov     r10, r20
        a_~x~y: mov     r20, r10
.endm
abc necel, STU
[Development result]
a_STU:  mov     r10, r20
a_stuy: mov     r20, r10

Example 3.

abc     .macro  x, xy
        ~ab:    mov r10, r20
.endm
abc stu, STU
[Development result]
ab:     mov     r10, r20