The concatenation operator concatenates two preprocessor tokens, forming a new token. It is most useful when at least one of the tokens are a parameter to a function-type macro.
Example
#define FOOBAR subi
#define IMMED(X)
X##i
#define SUBI(X,Y) X
## Y
When the IMMED
and SUBI
macros
are called like this:
IMMED(ld)
r16,1
SUBI(FOO,BAR)
r16,1
they will be expanded to
ldi
r16,0x1
subi
r16,0x1
FOO
and BAR
are first concatenated to
FOOBAR
, then FOOBAR
is expanded to
subi
.