By default, the assembler begins assembling all instructions in a file as 32-bit instructions. You can change the default action by using the --code_state=16 assembler (see Section 4.3) option, which causes the assembler to begin assembling all instructions in a file as 16-bit instructions. You can also use four directives that change how the assembler assembles instructions starting at the point where the directives occur:
- The .arm directive tells the assembler to begin assembling ARM UAL syntax 32-bit instructions starting at the location of the directive. The .arm directive performs an implicit word alignment before any instructions are written to the section to ensure that all 32-bit instructions are word aligned. The .arm directive also resets any local labels defined. The .arm directive is equivalent to the .state32 directive.
- The .state16 directive causes the assembler to begin assembling non-UAL 16-bit instructions starting at the location of the directive. The .state16 directive performs an implicit halfword alignment before any instructions are written to the section to ensure that all 16-bit instructions are halfword aligned. The .state16 directive also resets any local labels defined.
- The .state32 directive tells the assembler to begin assembling 32-bit instructions starting at the location of the directive. The .state32 directive performs an implicit word alignment before any instructions are written to the section to ensure that all 32-bit instructions are word aligned. The .state32 directive also resets any local labels defined.
- The .thumb directive tells the assembler to begin assembling Thumb or Thumb-2 UAL syntax instructions starting at the location of the directive. The .thumb directive performs an implicit word alignment before any instructions are written to the section to ensure that all instructions are word aligned. The .thumb directive also resets any local labels defined.