setend
Set Endianness (Thumb)
SETEND <endian>
Set endianness (Thumb).
Details
Set Endianness changes the endianness state in the CPSR: BE sets big-endian, LE sets little-endian. This Thumb instruction does not affect condition codes and requires appropriate privilege level (typically User mode cannot change this). The change takes effect on the next memory access.
Pseudocode Operation
if endian == 'BE' then
CPSR.E ← 1
elsif endian == 'LE' then
CPSR.E ← 0
Example
SETEND endian
Encoding
Binary Layout
1011011001
0
1
E
000
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';