sth

Store Halfword

sth RS, D(RA)

Stores the high half of a doubleword from a register to memory.

Details

The sth instruction stores the high half (bits 48-63) of the contents of register RS into the halfword in storage addressed by EA. The effective address (EA) is calculated as (RA|0) + EXTS64(D).

Pseudocode Operation

if 'sth' then
    EA ← (RA|0) + EXTS64(D)
    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

sth r3, 0(r4)

Encoding

Binary Layout
44
0
RS
6
RA
11
D
16
 
Format D-form
Opcode 0xB0000000
Extension Base

Operands

  • RS
    Source Register
  • D
    Displacement
  • RA
    Base Register