B8.5.1 Template modifiers common to AArch32 state and AArch64 state
The following template modifiers are common to both AArch32 state and AArch64 state.
c
Valid for an immediate operand. Prints it as a plain value without a
preceding #. Use this template modifier when using the operand in .word, or another data-generating directive,
which needs an integer without the #.
n
Valid for an immediate operand. Prints the arithmetic negation of the value
without a preceding #.
Example
// This uses an operand as the value in the .word directive. The .word
// directive does not accept numbers with a preceeding #, so we use the 'c'
// template modifier to print just the value.
int foo() {
int val;
__asm (R"(
ldr %0, 1f
b 2f
1:
.word %c1
2:
)"
: "=r" (val)
: "i" (0x12345678));
return val;
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.