I am trying to build a simple macro in GNU assembler (2.26.1) (gcc 5.4.0) but getting some error after several interactions: Invalid character '(' in mnemonic
I've tried to follow the advice at https://sourceware.org/binutils/docs/as/Macro.html with \() or & but no luck.
.macro macro_gen_irqh isrb, isre _irq_entry_\isrb\(): cli call isr_common_handler .if \isre-\isrb macro_gen_irqh "(\isrb+1)",\isre .endif .endm
If I replace the label _irq_entry_\isrb(): to "(\isrb)": it does work for the enumeration but without the required full label name.
The end result should be:
_irq_entry_0: cli call isr_common_handler_irq_entry_1:.._irq_entry_2:..