For the difference between ASR and LSR see the shifts with the same names.
Operation
Syntax
Semantic
Flags
Offset
ldr Rd, [Rb {, #const}]
Rd := [Rb + const]
-
str Rs, [Rb {, #const}]
[Rb + const] := Rs
-
Pre-offset
ldr Rd, [Rb {, #const}]!
Rb += const; Rd := [Rb]
-
str Rs, [Rb {, #const}]!
Rb += const; [Rb] := Rs
-
Post-offset
ldr Rd, [Rb], #const
Rd := [Rb]; Rb += const
-
str Rs, [Rb], #const
[Rb] := Rs; Rb += const
-
Indexed
ldr Rd, [Rb, Ri {, LSL n}]
Rd := [Rb + (Ri << n)]
-
str Rs, [Rb, Ri {, LSL n}]
[Rb + (Ri << n)] := Rs
-
Literal
ldr Rd, label
Rd := [label]
-
ldr Rd, [PC, #offset]
Rd := [PC + offset]
-
Positive stack
stmia Rs!, registers
for Ri in registers do [Rs] := Ri; Rs += 4
-
ldmdb Rs!, registers
for Ri in rev(registers) do Rs -= 4; Ri := [Rs]
-
Negative stack
stmdb Rs!, registers
for Ri in rev(registers) do Rs -= 4; [Rs] := Ri
-
ldmia Rs!, registers
for Ri in registers do Ri := [Rs]; Rs += 4
-
Note: most of the ldr/str memory instructions can have h or b appended to them to change to halfword (16 bit) / byte (8 bit) operations respectively.
Eg: ldrh r0, [r1] or strb r2, [r3]
if EX then [Rn + const] := Rs; Rd := 0 else Rd := 1
-
The synchronisation instructions work with a special "exclusive monitor"
(denoted EX in the table) that tracks the "exclusive state" of the CPU.
Every LDREX instruction will succeed and set the exclusive state to true.
An STREX instruction will check the exclusive state, and if true,
will execute the store, write 0 to Rd, and set the state to false. If the state
was already false, the store is not executed and Rd is set to 1. This entire
sequence is done atomically.
A context switch (such as an interrupt) will set the exclusive state to false.
The end effect is that only the first STREX performed after the latest LDREX
with no context switches in between will execute its store.
Instructions with an optional s suffix will only change the flags if this suffix is added.
Optional constants and shifts default to 0 / no shift.
Square brackets such as in [Rd] denote the memory stored at the given address,
in this case the address held in Rd.