sttr
Store Register (Unprivileged)
STTR <Wt>, [<Xn|SP>, #<simm>]
Stores a register as if in EL0 (User mode).
Details
Stores a 32-bit word from Wt to memory at [Xn + simm] with unprivileged semantics, as if the access were made from EL0. This is an AArch64-only instruction that may be used from higher privilege levels. No condition flags are affected.
Pseudocode Operation
address ← Xn + SignExtend(imm9); [address] ← Wt; access performed at EL0 privilege level
Example
STTR w3, [x1, #-8]
Encoding
Binary Layout
10
111
0
00
00
0
imm9
10
Rn
Rt
Operands
-
Wt
Transfer 32-bit integer register (load/store) -
Xn
First source / base 64-bit integer register -
simm
Signed immediate offset
Reference (Arm A64 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0xB8000800 | STTR <Wt>, [<Xn|SP>{, #<simm>}] | A64 | 10 | 111 | 0 | 00 | 00 | 0 | imm9 | 10 | Rn | Rt | ||
| 0xF8000800 | STTR <Xt>, [<Xn|SP>{, #<simm>}] | A64 | 11 | 111 | 0 | 00 | 00 | 0 | imm9 | 10 | Rn | Rt |
Description
Store Register (unprivileged) stores a word or doubleword from a register to memory. The address that is used for the store is calculated from a base register and an immediate offset.
Memory accesses made by the instruction behave as if the instruction was executed at EL0 if the Effective value of PSTATE.UAO is 0 and either:
Otherwise, the memory access operates with the restrictions determined by the Exception level at which the instruction is executed. For information about memory accesses, see Load/Store addressing modes.
Operation
bits(64) address;
bits(datasize) data;
boolean privileged = AArch64.IsUnprivAccessPriv();
AccessDescriptor accdesc = CreateAccDescGPR(MemOp_STORE, FALSE, privileged, tagchecked);
if n == 31 then
CheckSPAlignment();
address = SP[];
else
address = X[n, 64];
address = GenerateAddress(address, offset, accdesc);
data = X[t, datasize];
Mem[address, datasize DIV 8, accdesc] = data;