Instructions To Reverse Bytes In A General-Purpose Register - ARM ARM1176JZF-S Technical Reference Manual

Table of Contents

Advertisement

4.6

Instructions to reverse bytes in a general-purpose register

4.6.1
All load and store operations
ARM DDI 0301H
ID012310
When an application or device driver has to interface to memory-mapped peripheral registers or
shared-memory DMA 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.
ARM1176JZF-S instruction set summary on page 1-32 describes these instructions.
All load and store instructions take account of the CPSR E bit. Data is transferred directly to
registers when E = 0, and byte reversed if E = 1 for halfword, word, or multiple word transfers.
Operation:
When CPSR[<E-bit>] = 1 then byte reverse load/store data
Copyright © 2004-2009 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
Unaligned and Mixed-endian Data Access Support
4-20

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents