| |||
| Home > Unaligned and Mixed-Endian Data Access Support > Instructions to reverse bytes in a general-purpose register | |||
When an application or device driver has to interface to memory-mapped peripheral registers or shared-memory structures that are not the same endianness as that of the internal data structures, or the endianness of the Operating System, an efficient way of being able to explicitly transform the endianness of the data is required. The following new instructions are added to the ARM and Thumb instruction sets to provide this functionality:
reverse word (4 bytes) register, for transforming big and little-endian 32-bit representations
reverse halfword and sign-extend, for transforming signed 16-bit representations
reverse packed halfwords in a register for transforming big- and little-endian 16-bit representations.
These instructions are described in About the architecture.