0
votes

I'm trying to find any information parentheses syntax for macro arguments in GNU Assembler. E.g. I have following code:

    .macro      do_block, enc, in, rounds, rk, rkp, i
    eor     \in\().16b, \in\().16b, v15.16b
    ...

(taken from here)

What does paretheses in \in\().16b mean? Where to find documentaion for this syntax?

1

1 Answers

0
votes

Okay, I've found the answer. This is special syntax to escape macro-argument name.

From the documentation:

Note that since each of the macargs can be an identifier exactly as any other one permitted by the target architecture, there may be occasional problems if the target hand-crafts special meanings to certain characters when they occur in a special position. For example:

...

problems might occur with the period character (‘.’) which is often allowed inside opcode names (and hence identifier names). So for example constructing a macro to build an opcode from a base name and a length specifier like this:

.macro opcode base length
\base.\length
.endm

and invoking it as ‘opcode store l’ will not create a ‘store.l’ instruction but instead > generate some kind of error as the assembler tries to interpret the text \base.\length.

The string \() can be used to separate the end of a macro argument from the following text. eg:

    .macro opcode base length
    \base\().\length
    .endm