How to concatenate GNU GAS macro arguments with other tokens to make single label?
things like
\argA\()\argB :
should create a label composed by argA and argB.
EDIT
Testing, \()
seems to be not necessary; the test code was:
.file "test.c"
.macro prova argA, argB
\argA\argB :
.endm
.text
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
movl $0, %eax
popl %ecx
popl %ebp
leal -4(%ecx), %esp
prova abc, def
jmp abcdef
ret
.size main, .-main
.ident "GCC: (GNU) 4.3.2"
.section .note.GNU-stack,"",@progbits
which is just gcc -S test.c
output (lazyness:D) of a minimal C code. (prova
means test
in italian)
What's your favorite gas assembler reference?
The docs cover this one quite well https://sourceware.org/binutils/docs/as/Macro.html
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