You copied the Doc URL to your clipboard.

Instruction width selection in T32 code

Some T32 instructions can have either a 16-bit encoding or a 32-bit encoding.

If you do not specify the instruction size, by default:

  • For forward reference LDR, ADR, and B instructions, armasm always generates a 16-bit instruction, even if that results in failure for a target that could be reached using a 32-bit instruction.
  • For external reference LDR and B instructions, armasm always generates a 32-bit instruction.
  • In all other cases, armasm generates the smallest size encoding that can be output.

If you want to override this behavior, you can use the .W or .N width specifier to ensure a particular instruction size. armasm faults if it cannot generate an instruction with the specified width.

The .W specifier is ignored when assembling to A32 code, so you can safely use this specifier in code that might assemble to either A32 or T32 code. However, the .N specifier is faulted when assembling to A32 code.