lswi

Load String Word Immediate

lswi RT, RA, NB

Loads a sequence of bytes from memory into general-purpose registers.

Details

The lswi instruction loads a sequence of bytes from memory into general-purpose registers. The number of bytes to load is specified by the NB field, and the effective address is derived from register RA.

Pseudocode Operation

if RA = 0 then EA ← 0
else           EA ← (RA)
if NB = 0 then n ← 32
else           n ← NB
r ← RT - 1
i ← 32
do while n > 0
    if i = 32 then
        r ← r + 1 (mod 32)
        GPR(r) ← 0
    GPR(r)i:i+7 ← MEM(EA, 1)
    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, the system alignment error handler is invoked.

Example

lswi r3, r4, 4

Encoding

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

Operands

  • RT
    Start Register
  • RA
    Base
  • NB
    Byte Count