setend
Set Endianness
SETEND <endian>
Sets the endianness for data accesses (BE/LE).
Details
Sets the endianness mode (big-endian or little-endian) for subsequent data memory accesses in A32 execution state. This instruction modifies the E bit in the CPSR to control whether data is accessed in big-endian (BE) or little-endian (LE) format. No condition flags are affected. This is an A32-only instruction; attempting to execute it in other states may cause unpredictable behavior or generate an exception.
Pseudocode Operation
if endian == 'BE' then
CPSR.E ← 1
else if endian == 'LE' then
CPSR.E ← 0
Example
SETEND endian
Encoding
Binary Layout
111100010000
00
0
1
0
0
0
0
0
0
E
0
0
0
0
00000
Operands
-
endian
BE/LE
Reference (Arm AArch32 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0xF1010000 | SETEND{<q>} <endian_specifier> | A32 | 111100010000 | 00 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | E | 0 | 0 | 0 | 0 | 00000 | ||
| 0xB650 | SETEND{<q>} <endian_specifier> | T32 | 1011011001 | 0 | 1 | E | 000 |
Description
Set Endianness writes a new value to PSTATE.E.
Operation
EncodingSpecificOperations(); AArch32.CheckSETENDEnabled(); PSTATE.E = if set_bigend then '1' else '0';