Crate bracer

source ·
Expand description

Various macros to help write inline assembly for ARM targets.

These macros help you get your assembly written, but they have nearly no ability to help ensure that your assembly is correct. In rare cases where something can be statically known to be “obviously” wrong (eg: an invalid register name is picked for a specific instruction) the macro will panic.

Macros§

  • ARMv4T lacks the actual blx instruction, so this performs a “fake” blx-styled operation.
  • Reads SPSR to the register given.
  • Generates the asm string to set the CPU control bits.
  • Writes SPSR from the register given.
  • Emits a .section directive to place the code in a section name you pick.
  • Places .code 32 at the start and .code 16 at the end of the input sequence.
  • Emits code that will perform the test and skip past some lines if the test does not pass.