stdbrx

Store Doubleword Byte-Reverse Indexed

stdbrx RS, RA, RB

Swaps bytes and stores 64 bits.

Details

The stdbrx instruction stores a doubleword (64 bits) from the source register RS into memory at an effective address calculated by adding the contents of registers RA and RB. The data is stored in byte-reversed order.

Pseudocode Operation

if RA = 0 then b ← 0
else           b ← (RA)
EA ← b + (RB)
MEM(EA, 8) ← (RS)56:63 || (RS)48:55 || (RS)40:47 || (RS)32:39

Programming Note

The stdbrx instruction is useful for storing a doubleword in memory with byte-reversed order. Ensure that the source register RS contains the data to be stored, and registers RA and RB are correctly set to calculate the effective address. This instruction operates at user privilege level and may raise an exception if there's a memory access violation.

Example

stdbrx r3, r4, r5

Encoding

Binary Layout
31
0
RS
6
RA
11
RB
16
660
21
/
31
 
Format X-form
Opcode 0x7C000528
Extension Base

Operands

  • RS
    Source
  • RA
    Base
  • RB
    Index