stswi

Store String Word Immediate

stswi RT, RA, NB

Stores a string of words from general-purpose registers to memory, starting at the address in RA and using an immediate byte count.

Details

The stswi instruction stores a string of words from general-purpose registers to memory. The number of bytes to store is specified by the NB field. If NB is zero, 32 bytes are stored. The effective address (EA) is derived from RA. The data is stored from the low-order four bytes of each GPR starting from RS and wrapping around to GPR 0 if necessary.

Pseudocode Operation

if RA = 0 then EA ← 0
else           EA ← (RA)
if NB = 0 then n ← 32
else           n ← NB
r ← RS - 1
i ← 32
do while n > 0
    if i = 32 then r ← r + 1 (mod 32)
    MEM(EA, 1) ← GPR(r)i:i+7
    i ← i + 8
    if i = 64 then i ← 32
    EA ← EA + 1
    n ← n - 1

Programming Note

This instruction is not supported in Little-Endian mode. If it is executed in Little-Endian mode and NB > 0, the system alignment error handler is invoked.

Example

stswi r3, r4, 4

Encoding

Binary Layout
31
0
RT
6
RA
11
NB
16
725
/
 
Format X-form
Opcode 0x7C0005A5
Extension Base

Operands

  • RT
    Start Register
  • RA
    Base
  • NB
    Byte Count
  • RS
    Source General Purpose Register