sth
Store Halfword
Stores the high half of a doubleword from a register to memory.
Details
Store the low 16 bits of RS to the halfword in memory at the effective address formed by adding the displacement D (sign-extended) to RA, or to the displacement alone if RA is 0. This is a Base category instruction with no status field updates.
Pseudocode Operation
EA ← EXTS(D, 16) + (RA | 0)
MEM(EA, 2) ← RS[48:63]
Programming Note
The sth instruction stores the high half of a register value into memory. Ensure that the destination address is properly aligned to avoid alignment faults. This instruction operates at user privilege level and will raise an exception if the EA is out of bounds or if there are insufficient permissions.
Example
// Store 16-bit halfword.
Encoding
Operands
-
RS
Source Register -
D
Displacement -
RA
Base Register