GNU 汇编程序(Arm64)。宏参数引用中的括号
GNU Assembler (Arm64). Parentheses in macro arguments references
我试图在 GNU 汇编程序中查找宏参数的任何信息括号语法。例如。我有以下代码:
.macro do_block, enc, in, rounds, rk, rkp, i
eor \in\().16b, \in\().16b, v15.16b
...
(取自here)
\in\().16b
中的括号是什么意思?在哪里可以找到此语法的文档?
好的,我找到了答案。这是转义宏参数名称的特殊语法。
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
我试图在 GNU 汇编程序中查找宏参数的任何信息括号语法。例如。我有以下代码:
.macro do_block, enc, in, rounds, rk, rkp, i
eor \in\().16b, \in\().16b, v15.16b
...
(取自here)
\in\().16b
中的括号是什么意思?在哪里可以找到此语法的文档?
好的,我找到了答案。这是转义宏参数名称的特殊语法。
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